Interface BinarySubdocMutationRequest
-
- All Superinterfaces:
BinaryRequest
,BinarySubdocRequest
,CouchbaseMessage
,CouchbaseRequest
- All Known Implementing Classes:
AbstractSubdocMutationRequest
,SubArrayRequest
,SubCounterRequest
,SubDeleteRequest
,SubDictAddRequest
,SubDictUpsertRequest
,SubReplaceRequest
@Committed @Public public interface BinarySubdocMutationRequest extends BinarySubdocRequest
ABinarySubdocRequest
that describes a mutation operation. Mutations work on afragment()
of the enclosing JSON document, at the site denoted by theBinarySubdocRequest.path()
. If the path given doesn't exist in its entirety, some mutation operations can optionally offer to create intermediary nodes in the JSON if valid andcreateIntermediaryPath()
returnstrue
. Note that fragments should always be valid JSON. A sub-document mutation can also alter the enclosing document's expiry and flags.- Since:
- 1.2
- Author:
- Simon Baslé
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description long
cas()
boolean
createDocument()
Deprecated.boolean
createIntermediaryPath()
Sets whether missing nodes in theBinarySubdocRequest.path()
should be created as part of this mutation, when possible.boolean
expandMacros()
Sets whether macros such as ${Mutation.CAS} should be expandedint
expiration()
ByteBuf
fragment()
AByteBuf
containing the JSON fragment for the mutation.boolean
insertDocument()
Add document only if it does not existboolean
upsertDocument()
Upsert document if it does not existboolean
xattr()
Access to extended attribute section of the couchbase document-
Methods inherited from interface com.couchbase.client.core.message.kv.BinaryRequest
key, keyBytes, opaque, partition, partition
-
Methods inherited from interface com.couchbase.client.core.message.kv.subdoc.BinarySubdocRequest
content, opcode, path, pathLength
-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseMessage
creationTime
-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseRequest
bucket, complete, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, operationId, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, username
-
-
-
-
Method Detail
-
expiration
int expiration()
- Returns:
- the expiration (or TTL) to apply to the document along the mutation, 0 for no TTL.
-
fragment
ByteBuf fragment()
AByteBuf
containing the JSON fragment for the mutation. It is appended to theBinarySubdocRequest.content()
. This buffer is to be automatically released once the content has been written on the wire.- Returns:
- the target value for the mutation (a fragment of the whole JSON document, valid JSON itself)
-
createIntermediaryPath
boolean createIntermediaryPath()
Sets whether missing nodes in theBinarySubdocRequest.path()
should be created as part of this mutation, when possible. This is represented as an additional flag on the wire.- Returns:
- true if missing JSON nodes in the path should be created, false otherwise.
-
cas
long cas()
- Returns:
- the CAS to use for the mutation (if needed) or 0L to ignore
-
xattr
boolean xattr()
Access to extended attribute section of the couchbase document- Returns:
- true if accessing extended attribute section
-
expandMacros
boolean expandMacros()
Sets whether macros such as ${Mutation.CAS} should be expanded- Returns:
- true iff macros should be expanded
-
createDocument
@Deprecated boolean createDocument()
Deprecated.Create document if it does not exist. It is deprecated, useupsertDocument()
- Returns:
- true if creating document
-
upsertDocument
boolean upsertDocument()
Upsert document if it does not exist- Returns:
- true if creating document
-
insertDocument
boolean insertDocument()
Add document only if it does not exist- Returns:
- true if adding document
-
-