Collection
Operations that act on a Couchbase collection.
Functions
counter
Link copied to clipboard
fun counter(documentId: String, common: CommonOptions = CommonOptions.Default, durability: Durability = Durability.disabled(), expiry: Expiry = Expiry.none()): Counter
Content copied to clipboard
Returns a counter backed by a document on the server.
exists
Link copied to clipboard
suspend fun exists(id: String, common: CommonOptions = CommonOptions.Default): ExistsResult
Content copied to clipboard
get All Replicas
Link copied to clipboard
fun getAllReplicas(id: String, common: CommonOptions = CommonOptions.Default): Flow<GetReplicaResult>
Content copied to clipboard
get And Lock
Link copied to clipboard
suspend fun getAndLock(id: String, lockTime: Duration, common: CommonOptions = CommonOptions.Default): GetResult
Content copied to clipboard
get And Touch
Link copied to clipboard
suspend fun getAndTouch(id: String, expiry: Expiry, common: CommonOptions = CommonOptions.Default): GetResult
Content copied to clipboard
get Any Replica
Link copied to clipboard
suspend fun getAnyReplica(id: String, common: CommonOptions = CommonOptions.Default): GetReplicaResult
Content copied to clipboard
get Any Replica Or Null
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.
get Or Null
Link copied to clipboard
insert
Link copied to clipboard
inline suspend fun <T> insert(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.disabled(), expiry: Expiry = Expiry.None): MutationResult
Content copied to clipboard
lookup In
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.
mutate In
Link copied to clipboard
suspend fun mutateIn(id: String, common: CommonOptions = CommonOptions.Default, expiry: Expiry = Expiry.none(), preserveExpiry: Boolean = false, durability: Durability = Durability.disabled(), 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.disabled(), storeSemantics: StoreSemantics = StoreSemantics.replace(), serializer: JsonSerializer? = null, accessDeleted: Boolean = false, createAsDeleted: Boolean = false): MutateInResult
Content copied to clipboard
remove
Link copied to clipboard
suspend fun remove(id: String, common: CommonOptions = CommonOptions.Default, durability: Durability = Durability.disabled(), cas: Long = 0): MutationResult
Content copied to clipboard
replace
Link copied to clipboard
inline suspend fun <T> replace(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.disabled(), expiry: Expiry = Expiry.None, preserveExpiry: Boolean = false, cas: Long = 0): MutationResult
Content copied to clipboard
touch
Link copied to clipboard
suspend fun touch(id: String, expiry: Expiry, common: CommonOptions = CommonOptions.Default): MutationResult
Content copied to clipboard
unlock
Link copied to clipboard
suspend fun unlock(id: String, cas: Long, common: CommonOptions = CommonOptions.Default)
Content copied to clipboard
upsert
Link copied to clipboard
inline suspend fun <T> upsert(id: String, content: T, common: CommonOptions = CommonOptions.Default, transcoder: Transcoder? = null, durability: Durability = Durability.disabled(), expiry: Expiry = Expiry.None, preserveExpiry: Boolean = false): MutationResult
Content copied to clipboard
Updates a document if it exists, otherwise inserts it.