Collection
class Collection
Content copied to clipboard
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
exists
Link copied to clipboard
suspend fun exists(id: String, common: CommonOptions = CommonOptions.Default): ExistsResult
Content copied to clipboard
getAllReplicas
Link copied to clipboard
fun getAllReplicas(id: String, common: CommonOptions = CommonOptions.Default): Flow<GetReplicaResult>
Content copied to clipboard
getAndLock
Link copied to clipboard
suspend fun getAndLock(id: String, lockTime: Duration, common: CommonOptions = CommonOptions.Default): GetResult
Content copied to clipboard
getAndTouch
Link copied to clipboard
suspend fun getAndTouch(id: String, expiry: Expiry, common: CommonOptions = CommonOptions.Default): GetResult
Content copied to clipboard
getAnyReplica
Link copied to clipboard
suspend fun getAnyReplica(id: String, common: CommonOptions = CommonOptions.Default): GetReplicaResult
Content copied to clipboard
getAnyReplicaOrNull
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.
getOrNull
Link copied to clipboard
Like get, but returns null instead of throwing DocumentNotFoundException if the document is not found.
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
lookupIn
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
mutateIn
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