scanDocuments

@SinceCouchbase(value = "7.6")
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>

Depending on the scan type, returns from this collection:

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.

Parameters

type

Specifies which documents to include in the scan results. Defaults to every document in the collection.

consistency

By default, the scan runs immediately, without waiting for previous KV mutations to be indexed. If the scan results must include certain mutations, pass KvScanConsistency.consistentWith.

batchItemLimit

Tunes how many documents the server may send in a single round trip. The value is per partition (vbucket), so multiply by 1024 when calculating memory requirements. Might affect performance, but does not change the results of this method.

batchSizeLimit

Tunes how many bytes the server may send in a single round trip. The value is per partition (vbucket), so multiply by 1024 when calculating memory requirements. Might affect performance, but does not change the results of this method.