Packages

class AsyncCollection extends AnyRef

Provides asynchronous access to all collection APIs, based around Scala Futures. This is the main entry-point for key-value (KV) operations.

If synchronous, blocking access is needed, we recommend looking at the Collection. If a more advanced async API based around reactive programming is desired, then check out the ReactiveCollection.

Since

1.0.0

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

Instance Constructors

  1. new AsyncCollection(name: String, bucketName: String, scopeName: String, couchbaseOps: CoreCouchbaseOps, environment: ClusterEnvironment)

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 binary: AsyncBinaryCollection
  6. val bucketName: String
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  8. def core: Core
  9. val couchbaseOps: CoreCouchbaseOps
  10. val environment: ClusterEnvironment
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def exists(id: String, options: ExistsOptions): Future[ExistsResult]

    Checks if a document exists.

    Checks if a document exists.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Checks if a document exists.

    Checks if a document exists.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  15. def get(id: String, options: GetOptions): Future[GetResult]

    Fetches a full document from this collection.

    Fetches a full document from this collection.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Fetches a full document from this collection.

    Fetches a full document from this collection.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  17. def getAllReplicas(id: String, options: GetAllReplicasOptions): Seq[Future[GetReplicaResult]]

    Retrieves all available versions of the document.

    Retrieves all available versions of the document.

    Note that this will block the user's thread until all versions have been returned (or failed).

    Users needing a true non-blocking streaming version should use the reactive version.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  18. def getAllReplicas(id: String, timeout: Duration = kvReadTimeout): Seq[Future[GetReplicaResult]]

    Retrieves all available versions of the document.

    Retrieves all available versions of the document.

    Note that this will block the user's thread until all versions have been returned (or failed).

    Users needing a true non-blocking streaming version should use the reactive version.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  19. def getAndLock(id: String, lockTime: Duration, options: GetAndLockOptions): Future[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.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  20. def getAndLock(id: String, lockTime: Duration, timeout: Duration = kvReadTimeout): Future[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.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  21. def getAndTouch(id: String, expiry: Duration, options: GetAndTouchOptions): Future[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 asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  22. def getAndTouch(id: String, expiry: Duration, timeout: Duration = kvReadTimeout): Future[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 asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  23. def getAnyReplica(id: String, options: GetAnyReplicaOptions): Future[GetReplicaResult]

    Retrieves any available version of the document.

    Retrieves any available version of the document.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Retrieves any available version of the document.

    Retrieves any available version of the document.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  27. def insert[T](id: String, content: T, options: InsertOptions)(implicit serializer: JsonSerializer[T]): Future[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 asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  28. def insert[T](id: String, content: T, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf)(implicit serializer: JsonSerializer[T]): Future[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 asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def lookupIn(id: String, spec: Seq[LookupInSpec], options: LookupInOptions): Future[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.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  31. def lookupIn(id: String, spec: Seq[LookupInSpec], timeout: Duration = kvReadTimeout): Future[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.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  32. def lookupInAllReplicas(id: String, spec: Seq[LookupInSpec], options: LookupInAllReplicasOptions): Seq[Future[LookupInReplicaResult]]

    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.

    This variant will read and return all replicas of the document.

    Note that this will block the user's thread until all versions have been returned (or failed).

    Users needing a true non-blocking streaming version should use the reactive version.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

    Annotations
    @SinceCouchbase()
  33. def lookupInAllReplicas(id: String, spec: Seq[LookupInSpec], timeout: Duration = kvReadTimeout): Seq[Future[LookupInReplicaResult]]

    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.

    This variant will read and return all replicas of the document.

    Note that this will block the user's thread until all versions have been returned (or failed).

    Users needing a true non-blocking streaming version should use the reactive version.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

    Annotations
    @SinceCouchbase()
  34. def lookupInAnyReplica(id: String, spec: Seq[LookupInSpec], options: LookupInAnyReplicaOptions): Future[LookupInReplicaResult]

    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.

    This variant will read all replicas of the document, and return the first one found.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

    Annotations
    @SinceCouchbase()
  35. def lookupInAnyReplica(id: String, spec: Seq[LookupInSpec], timeout: Duration = kvReadTimeout): Future[LookupInReplicaResult]

    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.

    This variant will read all replicas of the document, and return the first one found.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

    Annotations
    @SinceCouchbase()
  36. def mutateIn(id: String, spec: Seq[MutateInSpec], options: MutateInOptions): Future[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.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  37. def mutateIn(id: String, spec: Seq[MutateInSpec], cas: Long = 0, document: StoreSemantics = StoreSemantics.Replace, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf): Future[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.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  38. val name: String
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  42. lazy val queryIndexes: AsyncCollectionQueryIndexManager

    Manage query indexes for this collection

  43. def remove(id: String, options: RemoveOptions): Future[MutationResult]

    Removes a document from this collection, if it exists.

    Removes a document from this collection, if it exists.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Removes a document from this collection, if it exists.

    Removes a document from this collection, if it exists.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  45. def replace[T](id: String, content: T, options: ReplaceOptions)(implicit serializer: JsonSerializer[T]): Future[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 asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  46. def replace[T](id: String, content: T, cas: Long = 0, durability: Durability = Disabled, timeout: Duration = Duration.MinusInf)(implicit serializer: JsonSerializer[T]): Future[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 asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  47. def scan(scanType: ScanType, opts: ScanOptions): Future[Iterator[ScanResult]]

    Initiates a KV range scan, which will return a non-blocking stream of KV documents.

    Initiates a KV range scan, which will return a non-blocking stream of KV documents.

    CAVEAT:This method is suitable for use cases that require relatively low concurrency and tolerate relatively high latency. If your application does many scans at once, or requires low latency results, we recommend using SQL++ (with a primary index on the collection) instead.

    Annotations
    @SinceCouchbase()
  48. def scan(scanType: ScanType): Future[Iterator[ScanResult]]

    Initiates a KV range scan, which will return a non-blocking stream of KV documents.

    Initiates a KV range scan, which will return a non-blocking stream of KV documents.

    Uses default options.

    CAVEAT:This method is suitable for use cases that require relatively low concurrency and tolerate relatively high latency. If your application does many scans at once, or requires low latency results, we recommend using SQL++ (with a primary index on the collection) instead.

    Annotations
    @SinceCouchbase()
  49. val scopeName: String
  50. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. def touch(id: String, expiry: Duration, options: TouchOptions): Future[MutationResult]

    Updates the expiry of the document with the given id.

    Updates the expiry of the document with the given id.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Updates the expiry of the document with the given id.

    Updates the expiry of the document with the given id.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Unlock a locked document.

    Unlock a locked document.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Unlock a locked document.

    Unlock a locked document.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Upserts the contents of a full document in this collection.

    Upserts the contents of a full document in this collection.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

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

    Upserts the contents of a full document in this collection.

    Upserts the contents of a full document in this collection.

    This asynchronous version performs the same functionality and takes the same parameters, but returns the same result object asynchronously in a Future.

  58. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  59. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  60. 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
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped