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
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.
Since:
1.2
Author:
Simon Baslé
  • Method Details

    • expiration

      int expiration()
      Returns:
      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.
      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 the BinarySubdocRequest.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, use upsertDocument()
      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