Interface BinarySubdocMutationRequest

All Superinterfaces:
BinaryRequest, BinarySubdocRequest, CouchbaseMessage, CouchbaseRequest
All Known Implementing Classes:
AbstractSubdocMutationRequest, SubArrayRequest, SubCounterRequest, SubDeleteRequest, SubDictAddRequest, SubDictUpsertRequest, SubReplaceRequest

public interface BinarySubdocMutationRequest
extends BinarySubdocRequest
A BinarySubdocRequest that describes a mutation operation. Mutations work on a fragment() of the enclosing JSON document, at the site denoted by the BinarySubdocRequest.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 and createIntermediaryPath() returns true. Note that fragments should always be valid JSON. A sub-document mutation can also alter the enclosing document's expiry and flags.
Simon Baslé
  • Method Details

    • expiration

      int expiration()
      the expiration (or TTL) to apply to the document along the mutation, 0 for no TTL.
    • fragment

      ByteBuf fragment()
      A ByteBuf containing the JSON fragment for the mutation. It is appended to the BinarySubdocRequest.content(). This buffer is to be automatically released once the content has been written on the wire.
      the target value for the mutation (a fragment of the whole JSON document, valid JSON itself)
    • createIntermediaryPath

      boolean createIntermediaryPath()
      Sets whether missing nodes in the BinarySubdocRequest.path() should be created as part of this mutation, when possible. This is represented as an additional flag on the wire.
      true if missing JSON nodes in the path should be created, false otherwise.
    • cas

      long cas()
      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
      true if accessing extended attribute section
    • expandMacros

      boolean expandMacros()
      Sets whether macros such as ${Mutation.CAS} should be expanded
      true iff macros should be expanded
    • createDocument

      @Deprecated boolean createDocument()
      Create document if it does not exist. It is deprecated, use upsertDocument()
      true if creating document
    • upsertDocument

      boolean upsertDocument()
      Upsert document if it does not exist
      true if creating document
    • insertDocument

      boolean insertDocument()
      Add document only if it does not exist
      true if adding document