TransactionAttemptContext

Functions

Link copied to clipboard
suspend fun get(collection: Collection, id: String): TransactionGetResult

Gets a document from the specified Couchbase collection matching the specified id.

Link copied to clipboard

Gets multiple documents at once, spending a tunable level of effort to minimize read skew.

Link copied to clipboard

Similar to getMulti, but fetches the documents from replicas in the preferred server group.

Link copied to clipboard

Gets a document (possibly a replica) from the specified Couchbase collection matching the specified id.

Link copied to clipboard
inline suspend fun <T> insert(collection: Collection, id: String, content: T, jsonSerializer: JsonSerializer? = null): TransactionGetResult

Inserts a new document into the specified Couchbase collection.

Link copied to clipboard
operator fun Collection.plus(documentId: String): TransactionDocumentSpec

Shorthand for creating a TransactionDocumentSpec.

Link copied to clipboard
suspend fun query(statement: String, parameters: QueryParameters = QueryParameters.None, scope: Scope? = null, serializer: JsonSerializer? = null, consistency: QueryScanConsistency = QueryScanConsistency.requestPlus(), readonly: Boolean = false, adhoc: Boolean = true, flexIndex: Boolean = false, profile: QueryProfile = QueryProfile.OFF, scanCap: Int? = null, pipelineBatch: Int? = null, pipelineCap: Int? = null, clientContextId: String? = UUID.randomUUID().toString(), raw: Map<String, Any?> = emptyMap()): QueryResult

Executes a SQL++ query, buffers all result rows in memory, and returns them as a QueryResult.

Link copied to clipboard
suspend fun remove(doc: TransactionGetResult)

Removes the specified doc.

Link copied to clipboard
inline suspend fun <T> replace(doc: TransactionGetResult, content: T, jsonSerializer: JsonSerializer? = null): TransactionGetResult

Mutates the specified doc with new content.