Packages

class Collection extends AnyRef

Provides blocking, synchronous access to all collection APIs. This is the main entry-point for key-value (KV) operations.

If asynchronous access is needed, we recommend looking at the AsyncCollection which is built around returning Futures, or the ReactiveCollection which provides a reactive programming API.

This blocking API itself is just a small layer on top of the AsyncCollection which blocks the current thread until the request completes with a response.

Since

1.0.0

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Collection
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Collection(async: AsyncCollection, bucketName: String)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val async: AsyncCollection
  6. val binary: BinaryCollection

    Provides access to less-commonly used methods.

  7. val bucketName: String
  8. def buffer[T](id: String, options: Option[CouchbaseCollectionOptions] = None)(implicit decode: JsonDeserializer[T], encode: JsonSerializer[T], tag: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): CouchbaseBuffer[T]

    Returns a com.couchbase.client.scala.datastructures.CouchbaseBuffer backed by this collection.

    Returns a com.couchbase.client.scala.datastructures.CouchbaseBuffer backed by this collection.

    id

    id of the document underyling the datastructure

    options

    options for controlling the behaviour of the datastructure

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException])
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def exists(id: String, options: ExistsOptions): Try[ExistsResult]

    Checks if a document exists.

    Checks if a document exists.

    This doesn't fetch the document so if the application simply needs to know if the document exists, this is the most efficient method.

    id

    the unique identifier of the document

    options

    configure options that affect this operation

    returns

    on success, a Success(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  13. def exists(id: String, timeout: Duration = kvReadTimeout): Try[ExistsResult]

    Checks if a document exists.

    Checks if a document exists.

    This doesn't fetch the document so if the application simply needs to know if the document exists, this is the most efficient method.

    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.ExistsOptions instead, which supports all available options.

    id

    the unique identifier of the document

    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(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  14. def get(id: String, options: GetOptions): Try[GetResult]

    Fetches a full document from this collection.

    Fetches a full document from this collection.

    id

    the unique identifier of the document

    options

    configure options that affect this operation

    returns

    on success, a Success(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  15. def get(id: String, timeout: Duration = kvReadTimeout): Try[GetResult]

    Fetches a full document from this collection.

    Fetches a full document from this collection.

    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.GetOptions instead, which supports all available options.

    id

    the unique identifier of the document

    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(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  16. def getAllReplicas(id: String, options: GetAllReplicasOptions): Iterable[GetReplicaResult]

    Retrieves all available versions of the document.

    Retrieves all available versions of the document.

    The application should default to using .get() instead. This method is intended for advanced scenarios, including where a particular write has ambiguously failed (e.g. it may or may not have succeeded), and the application wants to attempt manual verification and resolution.

    The returned Iterable will block on each call to next until the next replica has responded.

    id

    the unique identifier of the document

    options

    configure options that affect this operation

    returns

    on success, a Success(GetResult), else a Failure(CouchbaseException). This could be com.couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  17. def getAllReplicas(id: String, timeout: Duration = kvReadTimeout): Iterable[GetReplicaResult]

    Retrieves all available versions of the document.

    Retrieves all available versions of the document.

    The application should default to using .get() instead. This method is intended for advanced scenarios, including where a particular write has ambiguously failed (e.g. it may or may not have succeeded), and the application wants to attempt manual verification and resolution.

    The returned Iterable will block on each call to next until the next replica has responded.

    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.GetAllReplicasOptions instead, which supports all available options.

    id

    the unique identifier of the document

    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(GetResult), else a Failure(CouchbaseException). This could be com.couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  18. def getAndLock(id: String, lockTime: Duration, options: GetAndLockOptions): Try[GetResult]

    Fetches a full document from this collection, and simultaneously lock the document from writes.

    Fetches a full document from this collection, and simultaneously lock the document from writes.

    The CAS value returned in the kv.GetResult is the document's 'key': during the locked period, the document may only be modified by providing this CAS.

    id

    the unique identifier of the document

    lockTime

    how long to lock the document for

    returns

    on success, a Success(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  19. def getAndLock(id: String, lockTime: Duration, timeout: Duration = kvReadTimeout): Try[GetResult]

    Fetches a full document from this collection, and simultaneously lock the document from writes.

    Fetches a full document from this collection, and simultaneously lock the document from writes.

    The CAS value returned in the kv.GetResult is the document's 'key': during the locked period, the document may only be modified by providing this CAS.

    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.GetAndLockOptions instead, which supports all available options.

    id

    the unique identifier of the document

    lockTime

    how long to lock the document for

    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(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  20. def getAndTouch(id: String, expiry: Duration, timeout: Duration = kvReadTimeout): Try[GetResult]

    Fetches a full document from this collection, and simultaneously update the expiry value of the document.

    Fetches a full document from this collection, and simultaneously update the expiry value of the 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.GetAndTouchOptions instead, which supports all available options.

    id

    the unique identifier of the document

    expiry

    Couchbase documents optionally can have an expiration field set, e.g. when they will automatically expire. On mutations if this is left at the default (0), then any expiry will be removed and the document will never expire. If the application wants to preserve expiration then they should use the withExpiration parameter on any gets, and provide the returned expiration parameter to any mutations.

    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(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  21. def getAndTouch(id: String, expiry: Duration, options: GetAndTouchOptions): Try[GetResult]

    Fetches a full document from this collection, and simultaneously update the expiry value of the document.

    Fetches a full document from this collection, and simultaneously update the expiry value of the document.

    id

    the unique identifier of the document

    expiry

    Couchbase documents optionally can have an expiration field set, e.g. when they will automatically expire. On mutations if this is left at the default (0), then any expiry will be removed and the document will never expire. If the application wants to preserve expiration then they should use the withExpiration parameter on any gets, and provide the returned expiration parameter to any mutations.

    options

    configure options that affect this operation

    returns

    on success, a Success(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  22. def getAnyReplica(id: String, options: GetAnyReplicaOptions): Try[GetReplicaResult]

    Retrieves any available version of the document.

    Retrieves any available version of the document.

    The application should default to using .get() instead. This method is intended for high-availability situations where, say, a .get() operation has failed, and the application wants to return any - even possibly stale - data as soon as possible.

    Under the hood this sends a request to all configured replicas for the document, including the active, and whichever returns first is returned.

    id

    the unique identifier of the document

    options

    configure options that affect this operation

    returns

    on success, a Success(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  23. def getAnyReplica(id: String, timeout: Duration = kvReadTimeout): Try[GetReplicaResult]

    Retrieves any available version of the document.

    Retrieves any available version of the document.

    The application should default to using .get() instead. This method is intended for high-availability situations where, say, a .get() operation has failed, and the application wants to return any - even possibly stale - data as soon as possible.

    Under the hood this sends a request to all configured replicas for the document, including the active, and whichever returns first is returned.

    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.GetAnyReplicaOptions instead, which supports all available options.

    id

    the unique identifier of the document

    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(GetResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  26. def insert[T](id: String, content: T, options: InsertOptions)(implicit serializer: JsonSerializer[T]): Try[MutationResult]

    Inserts a full document into this collection, if it does not exist already.

    Inserts a full document into this collection, if it does not exist already.

    id

    the unique identifier of the document

    content

    this can be of any type for which an implicit com.couchbase.client.scala.codec.Conversions.JsonSerializer can be found: a list of types that are supported 'out of the box' is available at these JSON docs

    options

    configure options that affect this operation

    returns

    on success, a Success(MutationResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentAlreadyExistsException, indicating the document already exists. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  27. def insert[T](id: String, content: T, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf)(implicit serializer: JsonSerializer[T]): Try[MutationResult]

    Inserts a full document into this collection, if it does not exist already.

    Inserts a full document into this collection, if it does not exist already.

    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.InsertOptions instead, which supports all available options.

    id

    the unique identifier of the document

    content

    this can be of any type for which an implicit com.couchbase.client.scala.codec.Conversions.JsonSerializer can be found: a list of types that are supported 'out of the box' is available at these JSON docs

    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 a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentAlreadyExistsException, indicating the document already exists. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def lookupIn(id: String, spec: Seq[LookupInSpec], options: LookupInOptions): Try[LookupInResult]

    SubDocument lookups allow retrieving parts of a JSON document directly, which may be more efficient than retrieving the entire document.

    SubDocument lookups allow retrieving parts of a JSON document directly, which may be more efficient than retrieving the entire document.

    Individual operations can succeed or fail without affecting the others. See kv.LookupInResult for details on how to process the results.

    id

    the unique identifier of the document

    spec

    a sequence of LookupInSpec specifying what fields to fetch. See kv.LookupInSpec for more details.

    options

    configure options that affect this operation

    returns

    on success, a Success(LookupInResult), else a Failure(CouchbaseException). This could be com.couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  30. def lookupIn(id: String, spec: Seq[LookupInSpec], timeout: Duration = kvReadTimeout): Try[LookupInResult]

    SubDocument lookups allow retrieving parts of a JSON document directly, which may be more efficient than retrieving the entire document.

    SubDocument lookups allow retrieving parts of a JSON document directly, which may be more efficient than retrieving the entire document.

    Individual operations can succeed or fail without affecting the others. See kv.LookupInResult for details on how to process the results.

    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.LookupInOptions instead, which supports all available options.

    id

    the unique identifier of the document

    spec

    a sequence of LookupInSpec specifying what fields to fetch. See kv.LookupInSpec for more details.

    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(LookupInResult), else a Failure(CouchbaseException). This could be com.couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  31. def map[T](id: String, options: Option[CouchbaseCollectionOptions] = None)(implicit decode: JsonDeserializer[T], encode: JsonSerializer[T], tag: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): CouchbaseMap[T]

    Returns a com.couchbase.client.scala.datastructures.CouchbaseMap backed by this collection.

    Returns a com.couchbase.client.scala.datastructures.CouchbaseMap backed by this collection.

    id

    id of the document underyling the datastructure

    options

    options for controlling the behaviour of the datastructure

  32. def mutateIn(id: String, spec: Seq[MutateInSpec], options: MutateInOptions): Try[MutateInResult]

    Sub-Document mutations allow modifying parts of a JSON document directly, which can be more efficiently than fetching and modifying the full document.

    Sub-Document mutations allow modifying parts of a JSON document directly, which can be more efficiently than fetching and modifying the full document.

    Mutations are all-or-nothing: if one fails, then no mutation will be performed.

    id

    the unique identifier of the document

    spec

    a sequence of MutateInSpec specifying what mutations to apply to the document. See com.couchbase.client.scala.kv.MutateInSpec for more details.

    options

    configure options that affect this operation

    returns

    on success, a Success(MutateInResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  33. def mutateIn(id: String, spec: Seq[MutateInSpec], cas: Long = 0, document: StoreSemantics = StoreSemantics.Replace, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Try[MutateInResult]

    Sub-Document mutations allow modifying parts of a JSON document directly, which can be more efficiently than fetching and modifying the full document.

    Sub-Document mutations allow modifying parts of a JSON document directly, which can be more efficiently than fetching and modifying the full document.

    Mutations are all-or-nothing: if one fails, then no mutation will be performed.

    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.MutateInOptions instead, which supports all available options.

    id

    the unique identifier of the document

    spec

    a sequence of MutateInSpec specifying what mutations to apply to the document. See com.couchbase.client.scala.kv.MutateInSpec for more details.

    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. The default is 0, which disables CAS checking.

    document

    controls whether the document should be inserted, upserted, or not touched. See com.couchbase.client.scala.kv.StoreSemantics for details.

    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(MutateInResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  34. def name: String
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def queue[T](id: String, options: Option[CouchbaseCollectionOptions] = None)(implicit decode: JsonDeserializer[T], encode: JsonSerializer[T], tag: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): CouchbaseQueue[T]

    Returns a com.couchbase.client.scala.datastructures.CouchbaseQueue backed by this collection.

    Returns a com.couchbase.client.scala.datastructures.CouchbaseQueue backed by this collection.

    id

    id of the document underyling the datastructure

    options

    options for controlling the behaviour of the datastructure

  39. val reactive: ReactiveCollection

    Provides access to a reactive-programming version of this API.

  40. def remove(id: String, options: RemoveOptions): Try[MutationResult]

    Removes a document from this collection, if it exists.

    Removes a document from this collection, if it exists.

    id

    the unique identifier of the document

    options

    configure options that affect this operation

    returns

    on success, a Success(MutationResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  41. def remove(id: String, cas: Long = 0, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Try[MutationResult]

    Removes a document from this collection, if it exists.

    Removes a document from this collection, if it exists.

    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.RemoveOptions instead, which supports all available options.

    id

    the unique identifier of the document

    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. 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 a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  42. def replace[T](id: String, content: T, options: ReplaceOptions)(implicit serializer: JsonSerializer[T]): Try[MutationResult]

    Replaces the contents of a full document in this collection, if it already exists.

    Replaces the contents of a full document in this collection, if it already exists.

    id

    the unique identifier of the document

    content

    this can be of any type for which an implicit com.couchbase.client.scala.codec.Conversions.JsonSerializer can be found: a list of types that are supported 'out of the box' is available at these JSON docs

    options

    configure options that affect this operation

    returns

    on success, a Success(MutationResult), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  43. def replace[T](id: String, content: T, cas: Long = 0, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf)(implicit serializer: JsonSerializer[T]): Try[MutationResult]

    Replaces the contents of a full document in this collection, if it already exists.

    Replaces the contents of a full document in this collection, if it already exists.

    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.ReplaceOptions instead, which supports all available options.

    id

    the unique identifier of the document

    content

    this can be of any type for which an implicit com.couchbase.client.scala.codec.Conversions.JsonSerializer can be found: a list of types that are supported 'out of the box' is available at these JSON docs

    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. 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 a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  44. def scopeName: String
  45. def set[T](id: String, options: Option[CouchbaseCollectionOptions] = None)(implicit decode: JsonDeserializer[T], encode: JsonSerializer[T], tag: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): CouchbaseSet[T]

    Returns a com.couchbase.client.scala.datastructures.CouchbaseSet backed by this collection.

    Returns a com.couchbase.client.scala.datastructures.CouchbaseSet backed by this collection.

    id

    id of the document underyling the datastructure

    options

    options for controlling the behaviour of the datastructure

  46. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  47. def toString(): String
    Definition Classes
    AnyRef → Any
  48. def touch(id: String, expiry: Duration, options: TouchOptions): Try[MutationResult]

    Updates the expiry of the document with the given id.

    Updates the expiry of the document with the given id.

    id

    the unique identifier of the document

    options

    configure options that affect this operation

    returns

    on success, a Success(MutationResult), else a Failure(CouchbaseException). This could be com.couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  49. def touch(id: String, expiry: Duration, timeout: Duration = kvReadTimeout): Try[MutationResult]

    Updates the expiry of the document with the given id.

    Updates the expiry of the document with the given id.

    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.TouchOptions instead, which supports all available options.

    id

    the unique identifier of the document

    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 a Failure(CouchbaseException). This could be com.couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  50. def unlock(id: String, cas: Long, options: UnlockOptions): Try[Unit]

    Unlock a locked document.

    Unlock a locked document.

    id

    the unique identifier of the document

    cas

    must match the CAS value return from a previous .getAndLock() to successfully unlock the document

    options

    configure options that affect this operation

    returns

    on success, a Success(Unit), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  51. def unlock(id: String, cas: Long, timeout: Duration = kvReadTimeout): Try[Unit]

    Unlock a locked document.

    Unlock a locked 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.UnlockOptions instead, which supports all available options.

    id

    the unique identifier of the document

    cas

    must match the CAS value return from a previous .getAndLock() to successfully unlock the document

    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(Unit), else a Failure(CouchbaseException). This could be com .couchbase.client.core.error.DocumentDoesNotExistException, indicating the document could not be found. any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  52. def upsert[T](id: String, content: T, options: UpsertOptions)(implicit serializer: JsonSerializer[T]): Try[MutationResult]

    Upserts the contents of a full document in this collection.

    Upserts the contents of a full document in this collection.

    Upsert here means to insert the document if it does not exist, or replace the content if it does.

    id

    the unique identifier of the document

    content

    this can be of any type for which an implicit com.couchbase.client.scala.codec.Conversions.JsonSerializer can be found: a list of types that are supported 'out of the box' is available at these JSON docs

    options

    configure options that affect this operation

    returns

    on success, a Success(MutationResult), else a Failure(CouchbaseException). any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  53. def upsert[T](id: String, content: T, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf)(implicit serializer: JsonSerializer[T]): Try[MutationResult]

    Upserts the contents of a full document in this collection.

    Upserts the contents of a full document in this collection.

    Upsert here means to insert the document if it does not exist, or replace the content if it does.

    This overloads 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.UpsertOptions instead, which supports all available options.

    id

    the unique identifier of the document

    content

    this can be of any type for which an implicit com.couchbase.client.scala.codec.Conversions.JsonSerializer can be found: a list of types that are supported 'out of the box' is available at these JSON docs

    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 a Failure(CouchbaseException). any scala.util.control.NonFatal error returned will derive ultimately from com.couchbase.client.core.error.CouchbaseException. See the error handling docs for more detail.

  54. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  55. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  56. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped