Collection
Operations that act on a Couchbase collection.
Functions
Link copied to clipboard
fun counter(documentId: String, common: CommonOptions = CommonOptions.Default, durability: Durability = Durability.none(), expiry: Expiry = Expiry.none()): Counter
Content copied to clipboard
Returns a counter backed by a document on the server.
Link copied to clipboard
suspend fun exists(id: String, common: CommonOptions = CommonOptions.Default): ExistsResult
Content copied to clipboard
Link copied to clipboard
fun getAllReplicas(id: String, common: CommonOptions = CommonOptions.Default): Flow<GetReplicaResult>
Content copied to clipboard
Link copied to clipboard
suspend fun getAndLock(id: String, lockTime: Duration, common: CommonOptions = CommonOptions.Default): GetResult
Content copied to clipboard
Link copied to clipboard
suspend fun getAndTouch(id: String, expiry: Expiry, common: CommonOptions = CommonOptions.Default): GetResult
Content copied to clipboard
Link copied to clipboard
suspend fun getAnyReplica(id: String, common: CommonOptions = CommonOptions.Default): GetReplicaResult
Content copied to clipboard
Link copied to clipboard
suspend fun getAnyReplicaOrNull(id: String, common: CommonOptions = CommonOptions.Default): GetReplicaResult?
Content copied to clipboard
Like getAnyReplica, but returns null instead of throwing DocumentUnretrievableException if the document was not found.
Link copied to clipboard
Link copied to clipboard
inline suspend fun <T> insert(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.none(), expiry: Expiry = Expiry.None): MutationResult
Content copied to clipboard
Link copied to clipboard
suspend fun lookupIn(id: String, spec: LookupInSpec, common: CommonOptions = CommonOptions.Default, accessDeleted: Boolean = false): LookupInResult
Content copied to clipboard
inline suspend fun <T, L : LookupInSpec> lookupIn(id: String, spec: L, common: CommonOptions = CommonOptions.Default, accessDeleted: Boolean = false, block: LookupInResult.() -> T): T
Content copied to clipboard
Retrieves specific fields of a document.
Link copied to clipboard
suspend fun mutateIn(id: String, common: CommonOptions = CommonOptions.Default, expiry: Expiry = Expiry.none(), preserveExpiry: Boolean = false, durability: Durability = Durability.none(), storeSemantics: StoreSemantics = StoreSemantics.replace(), serializer: JsonSerializer? = null, accessDeleted: Boolean = false, createAsDeleted: Boolean = false, block: MutateInSpec.() -> Unit): MutateInResult
Content copied to clipboard
suspend fun mutateIn(id: String, spec: MutateInSpec, common: CommonOptions = CommonOptions.Default, expiry: Expiry = Expiry.none(), preserveExpiry: Boolean = false, durability: Durability = Durability.none(), storeSemantics: StoreSemantics = StoreSemantics.replace(), serializer: JsonSerializer? = null, accessDeleted: Boolean = false, createAsDeleted: Boolean = false): MutateInResult
Content copied to clipboard
Link copied to clipboard
suspend fun remove(id: String, common: CommonOptions = CommonOptions.Default, durability: Durability = Durability.none(), cas: Long = 0): MutationResult
Content copied to clipboard
Link copied to clipboard
suspend fun removeOrNull(id: String, common: CommonOptions = CommonOptions.Default, durability: Durability = Durability.none(), cas: Long = 0): MutationResult?
Content copied to clipboard
Like remove, but returns null instead of throwing DocumentNotFoundException if the document was not found.
Link copied to clipboard
inline suspend fun <T> replace(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.none(), expiry: Expiry = Expiry.None, @SinceCouchbase(value = "7.0" ) preserveExpiry: Boolean = false, cas: Long = 0): MutationResult
Content copied to clipboard
Link copied to clipboard
fun scanDocuments(type: ScanType = ScanType.range(), common: CommonOptions = CommonOptions.Default, consistency: KvScanConsistency = KvScanConsistency.notBounded(), batchItemLimit: Int = DEFAULT_SCAN_BATCH_ITEM_LIMIT, batchSizeLimit: StorageSize = DEFAULT_SCAN_BATCH_SIZE_LIMIT): Flow<GetResult>
Content copied to clipboard
Depending on the scan type, returns from this collection:
Link copied to clipboard
fun scanIds(type: ScanType = ScanType.range(), common: CommonOptions = CommonOptions.Default, consistency: KvScanConsistency = KvScanConsistency.notBounded(), batchItemLimit: Int = DEFAULT_SCAN_BATCH_ITEM_LIMIT, batchSizeLimit: StorageSize = DEFAULT_SCAN_BATCH_SIZE_LIMIT): Flow<String>
Content copied to clipboard
Like scanDocuments, but returns only document IDs instead of full documents.
Link copied to clipboard
suspend fun touch(id: String, expiry: Expiry, common: CommonOptions = CommonOptions.Default): MutationResult
Content copied to clipboard
Link copied to clipboard
suspend fun unlock(id: String, cas: Long, common: CommonOptions = CommonOptions.Default)
Content copied to clipboard
Link copied to clipboard
inline suspend fun <T> upsert(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.none(), expiry: Expiry = Expiry.None, @SinceCouchbase(value = "7.0" ) preserveExpiry: Boolean = false): MutationResult
Content copied to clipboard
Updates a document if it exists, otherwise inserts it.
Properties
Link copied to clipboard
@SinceCouchbase(value = "7.0" )
Content copied to clipboard