class BinaryCollection extends AnyRef
Operations on non-JSON Couchbase documents.
- Alphabetic
- By Inheritance
- BinaryCollection
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new BinaryCollection(async: AsyncBinaryCollection)
- async
an asynchronous version of this API
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def append(id: String, content: Array[Byte], options: AppendOptions): Try[MutationResult]
Add bytes to the end of a Couchbase binary document.
Add bytes to the end of a Couchbase binary document.
this method should not be used with JSON documents. This operates at the byte level and is unsuitable for dealing with JSON documents. Use this method only when explicitly dealing with binary or UTF-8 documents. It may invalidate an existing JSON document.
- id
the unique identifier of the document
- content
the bytes to append
- options
configure options that affect this operation
- returns
on success, a
Success(MutationResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- def append(id: String, content: Array[Byte], cas: Long = 0, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Try[MutationResult]
Add bytes to the end of a Couchbase binary document.
Add bytes to the end of a Couchbase binary document.
this method should not be used with JSON documents. This operates at the byte level and is unsuitable for dealing with JSON documents. Use this method only when explicitly dealing with binary or UTF-8 documents. It may invalidate an existing JSON document.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes an com.couchbase.client.scala.kv.AppendOptions instead, which supports all available options.
- id
the unique identifier of the document
- content
the bytes to append
- cas
Couchbase documents all have a CAS (Compare-And-Set) field, a simple integer that allows optimistic concurrency - e.g. it can detect if another agent has modified a document in-between this agent getting and modifying the document. See these JSON docs for a full description. The default is 0, which disables CAS checking.
- durability
writes in Couchbase are written to a single node, and from there the Couchbase Server will take care of sending that mutation to any configured replicas. This parameter provides some control over ensuring the success of the mutation's replication. See com.couchbase.client.scala.durability.Durability for a detailed discussion.
- timeout
when the operation will timeout. This will default to
timeoutConfig().kvTimeout()
in the provided com.couchbase.client.scala.env.ClusterEnvironment.- returns
on success, a
Success(MutationResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val async: AsyncBinaryCollection
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def decrement(id: String, delta: Long, options: DecrementOptions): Try[CounterResult]
Decrement a Couchbase 'counter' document.
Decrement a Couchbase 'counter' document. though it is common to use Couchbase to store exclusively JSON, Couchbase is actually agnostic to what is stored. It is possible to use a document as a 'counter' - e.g. it stores an integer. This is useful for use-cases such as implementing AUTO_INCREMENT-style functionality, where each new document can be given a unique monotonically increasing id.
this method should not be used with JSON documents. Use this method only when explicitly dealing with counter documents. It may invalidate an existing JSON document.
- id
the unique identifier of the document
- delta
the amount to decrement by, which should be a positive amount
- options
configure options that affect this operation
- returns
on success, a
Success(CounterResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- def decrement(id: String, delta: Long, initial: Option[Long] = None, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Try[CounterResult]
Decrement a Couchbase 'counter' document.
Decrement a Couchbase 'counter' document. though it is common to use Couchbase to store exclusively JSON, Couchbase is actually agnostic to what is stored. It is possible to use a document as a 'counter' - e.g. it stores an integer. This is useful for use-cases such as implementing AUTO_INCREMENT-style functionality, where each new document can be given a unique monotonically increasing id.
this method should not be used with JSON documents. Use this method only when explicitly dealing with counter documents. It may invalidate an existing JSON document.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes an com.couchbase.client.scala.kv.DecrementOptions instead, which supports all available options.
- id
the unique identifier of the document
- delta
the amount to decrement by, which should be a positive amount
- initial
if not-None, the amount to initialise the document too, if it does not exist. If this is not set, and the document does not exist, Failure(DocumentDoesNotExistException) will be returned
- durability
writes in Couchbase are written to a single node, and from there the Couchbase Server will take care of sending that mutation to any configured replicas. This parameter provides some control over ensuring the success of the mutation's replication. See com.couchbase.client.scala.durability.Durability for a detailed discussion.
- timeout
when the operation will timeout. This will default to
timeoutConfig().kvTimeout()
in the provided com.couchbase.client.scala.env.ClusterEnvironment.- returns
on success, a
Success(CounterResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def increment(id: String, delta: Long, options: IncrementOptions): Try[CounterResult]
Increment a Couchbase 'counter' document.
Increment a Couchbase 'counter' document. though it is common to use Couchbase to store exclusively JSON, Couchbase is actually agnostic to what is stored. It is possible to use a document as a 'counter' - e.g. it stores an integer. This is useful for use-cases such as implementing AUTO_INCREMENT-style functionality, where each new document can be given a unique monotonically increasing id.
this method should not be used with JSON documents. Use this method only when explicitly dealing with counter documents. It may invalidate an existing JSON document.
- id
the unique identifier of the document
- delta
the amount to increment by
- options
configure options that affect this operation
- returns
on success, a
Success(CounterResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- def increment(id: String, delta: Long, initial: Option[Long] = None, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Try[CounterResult]
Increment a Couchbase 'counter' document.
Increment a Couchbase 'counter' document. though it is common to use Couchbase to store exclusively JSON, Couchbase is actually agnostic to what is stored. It is possible to use a document as a 'counter' - e.g. it stores an integer. This is useful for use-cases such as implementing AUTO_INCREMENT-style functionality, where each new document can be given a unique monotonically increasing id.
this method should not be used with JSON documents. Use this method only when explicitly dealing with counter documents. It may invalidate an existing JSON document.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes an com.couchbase.client.scala.kv.IncrementOptions instead, which supports all available options.
- id
the unique identifier of the document
- delta
the amount to increment by
- initial
if not-None, the amount to initialise the document too, if it does not exist. If this is not set, and the document does not exist, Failure(DocumentDoesNotExistException) will be returned
- durability
writes in Couchbase are written to a single node, and from there the Couchbase Server will take care of sending that mutation to any configured replicas. This parameter provides some control over ensuring the success of the mutation's replication. See com.couchbase.client.scala.durability.Durability for a detailed discussion.
- timeout
when the operation will timeout. This will default to
timeoutConfig().kvTimeout()
in the provided com.couchbase.client.scala.env.ClusterEnvironment.- returns
on success, a
Success(CounterResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def prepend(id: String, content: Array[Byte], options: PrependOptions): Try[MutationResult]
Add bytes to the beginning of a Couchbase binary document.
Add bytes to the beginning of a Couchbase binary document.
this method should not be used with JSON documents. This operates at the byte level and is unsuitable for dealing with JSON documents. Use this method only when explicitly dealing with binary or UTF-8 documents. It may invalidate an existing JSON document.
- id
the unique identifier of the document
- content
the bytes to append
- options
configure options that affect this operation
- returns
on success, a
Success(MutationResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- def prepend(id: String, content: Array[Byte], cas: Long = 0, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Try[MutationResult]
Add bytes to the beginning of a Couchbase binary document.
Add bytes to the beginning of a Couchbase binary document.
this method should not be used with JSON documents. This operates at the byte level and is unsuitable for dealing with JSON documents. Use this method only when explicitly dealing with binary or UTF-8 documents. It may invalidate an existing JSON document.
This overload provides only the most commonly used options. If you need to configure something more esoteric, use the overload that takes an com.couchbase.client.scala.kv.PrependOptions instead, which supports all available options.
- id
the unique identifier of the document
- content
the bytes to append
- cas
Couchbase documents all have a CAS (Compare-And-Set) field, a simple integer that allows optimistic concurrency - e.g. it can detect if another agent has modified a document in-between this agent getting and modifying the document. See these JSON docs for a full description. The default is 0, which disables CAS checking.
- durability
writes in Couchbase are written to a single node, and from there the Couchbase Server will take care of sending that mutation to any configured replicas. This parameter provides some control over ensuring the success of the mutation's replication. See com.couchbase.client.scala.durability.Durability for a detailed discussion.
- timeout
when the operation will timeout. This will default to
timeoutConfig().kvTimeout()
in the provided com.couchbase.client.scala.env.ClusterEnvironment.- returns
on success, a
Success(MutationResult)
, else aFailure(CouchbaseException)
. This could becom.couchbase.client.core.error.DocumentDoesNotExistException
, indicating the document could not be found. anyscala.util.control.NonFatal
error returned will derive ultimately fromcom.couchbase.client.core.error.CouchbaseException
. See the error handling docs for more detail.
- lazy val reactive: ReactiveBinaryCollection
A reactive version of this API.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)