/// /// import { ArrayElement, BucketName, CasInput, CollectionName, CouchbaseClusterTypes, DefaultClusterTypes, DocDef, DocDefBodyShape, DocDefMatchingBody, DocDefMatchingKey, If, IsAny, IsFuzzyDocument, IsNever, OneOf, ScopeName } from '@cbjsdev/shared'; import { AppendOptions, BinaryCollection, DecrementOptions, IncrementOptions, PrependOptions } from './binarycollection.js'; import type { CppConnection, CppDocumentId, CppRangeScanOrchestratorOptions, CppScanIterator } from './binding.js'; import type { Cluster } from './cluster.js'; import { CollectionDocDef, CollectionDocDefMatchingKey, CollectionMatchingDocDef, CollectionOptions, ExtractCollectionJsonDocDef, ExtractCollectionJsonDocKey } from './clusterTypes/clusterTypes.js'; import type { LookupInSpecResults, NarrowLookupSpecs } from './clusterTypes/kv/lookup/lookupIn.types.js'; import { MutateInSpecResults, NarrowMutationSpecs } from './clusterTypes/kv/mutation/mutateIn.types.js'; import { CounterResult, ExistsResult, GetReplicaResult, GetResult, LookupInReplicaResult, LookupInResult, MutateInResult, MutationResult, ScanResult } from './crudoptypes.js'; import { DurabilityLevel, ReadPreference, StoreSemantics } from './generaltypes.js'; import { MutationState } from './mutationstate.js'; import { CollectionQueryIndexManager } from './queryindexmanager.js'; import { PrefixScan, RangeScan, SamplingScan } from './rangeScan.js'; import type { Scope } from './scope.js'; import { MutateInSpec } from './sdspecs.js'; import { CouchbaseList, CouchbaseMap, CouchbaseQueue, CouchbaseSet } from './services/kv/dataStructures/index.js'; import { ChainableLookupIn } from './services/kv/lookupIn/ChainableLookupIn.js'; import { LookupResult } from './services/kv/lookupIn/types.js'; import type { MutateInReturnType } from './services/kv/mutateIn/types.js'; import { StreamableReplicasPromise, StreamableScanPromise } from './streamablepromises.js'; import { RequestSpan } from './tracing.js'; import type { Transcoder } from './transcoders.js'; import { NodeCallback, VoidNodeCallback } from './utilities.js'; /** * @category Key-Value */ export interface GetOptions { /** * Specifies a list of fields within the document which should be fetched. * This allows for easy retrieval of select fields without incurring the * overhead of fetching the whole document. */ project?: string | string[]; /** * Indicates that the expiry of the document should be fetched alongside * the data itself. */ withExpiry?: WithExpiry; /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * When true, throws a `DocumentNotFoundError` if the document is not found. * When false, returns undefined. * @default true */ throwIfMissing?: ThrowIfMissing; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface ExistsOptions { /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } export type ClientDurabilityOptions = { /** * Specifies the number of nodes this operation should be persisted to * before it is considered successful. Note that this option is mutually * exclusive of {@link durabilityLevel}. */ durabilityPersistTo: number; /** * Specifies the number of nodes this operation should be replicated to * before it is considered successful. Note that this option is mutually * exclusive of {@link durabilityLevel}. */ durabilityReplicateTo: number; }; export type ServerDurabilityOptions = { /** * Specifies the level of synchronous durability for this operation. */ durabilityLevel: DurabilityLevel; }; export type DurabilityOptions = OneOf<[ClientDurabilityOptions, ServerDurabilityOptions]>; export type MutationOptions = Partial & { /** * Specifies the expiry time for the document. * * The expiry can be provided as: * - A `number` of seconds relative to the current time. * - A `Date` object for an absolute expiry time. * * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ). */ expiry?: number | Date; /** * Specifies that any existing expiry on the document should be preserved. */ preserveExpiry?: boolean; /** * If specified, indicates that operation should be failed if the CAS * has changed from this value, indicating that the document has changed. */ cas?: CasInput; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; }; /** * @category Key-Value */ export type InsertOptions = Omit; /** * @category Key-Value */ export type UpsertOptions = Omit; /** * @category Key-Value */ export type ReplaceOptions = MutationOptions; /** * @category Key-Value */ export type RemoveOptions = Omit; /** * @category Key-Value */ export interface GetAnyReplicaOptions { /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * When true, throws a `DocumentNotFoundError` if the document is not found. * When false, returns undefined. * @default true */ throwIfMissing?: ThrowIfMissing; /** * Specifies how replica nodes will be filtered. */ readPreference?: ReadPreference; } /** * @category Key-Value */ export interface GetAllReplicasOptions { /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * Specifies how replica nodes will be filtered. */ readPreference?: ReadPreference; } /** * @category Key-Value */ export interface TouchOptions { /** * Specifies the level of synchronous durability for this operation. */ durabilityLevel?: DurabilityLevel; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface GetAndTouchOptions { /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface GetAndLockOptions { /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface UnlockOptions { /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface LookupInOptions { /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * For internal use only - allows access to deleted documents that are in 'tombstone' form * * @internal */ accessDeleted?: boolean; /** * When `true`, the operation will throw if any {@link LookupInSpec} fails. * The first spec error will be thrown. * * @default false */ throwOnSpecError?: ThrowOnSpecError; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface LookupInAnyReplicaOptions { /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * When `true`, the operation will throw if any {@link LookupInSpec} fails. * The first spec error will be thrown. * * @default false */ throwOnSpecError?: ThrowOnSpecError; /** * Specifies how replica nodes will be filtered. */ readPreference?: ReadPreference; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export interface LookupInAllReplicasOptions { /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * When `true`, the operation will throw if any {@link LookupInSpec} fails. * The first spec error will be thrown. * * @default false */ throwOnSpecError?: ThrowOnSpecError; /** * Specifies how replica nodes will be filtered. */ readPreference?: ReadPreference; /** * The parent span for this operation, used to establish a trace hierarchy * for observability. */ parentSpan?: RequestSpan; } /** * @category Key-Value */ export type MutateInOptions = MutationOptions & { /** * Specifies the store semantics to use for this operation. */ storeSemantics?: StoreSemantics; /** * Specifies whether the operation should be performed with upsert semantics, * creating the document if it does not already exist. * * @deprecated Use {@link MutateInOptions.storeSemantics} instead. */ upsertDocument?: boolean; }; /** * @category Key-Value */ export interface ScanOptions { /** * Specifies an explicit transcoder to use for this specific operation. */ transcoder?: Transcoder; /** * The timeout for this operation, represented in milliseconds. */ timeout?: number; /** * If the scan should only return document ids. */ idsOnly?: boolean; /** * The limit applied to the number of bytes returned from the server * for each partition batch. */ batchByteLimit?: number; /** * The limit applied to the number of items returned from the server * for each partition batch. */ batchItemLimit?: number; /** * Specifies a MutationState which the scan should be consistent with. * * @see MutationState */ consistentWith?: MutationState; /** * Specifies the number of vBuckets which the client should scan in parallel. */ concurrency?: number; } /** * Exposes the operations which are available to be performed against a collection. * Namely the ability to perform KV operations. * * @category Core */ export declare class Collection = BucketName, in out S extends ScopeName = ScopeName, in out C extends CollectionName = CollectionName> { /** * @internal */ readonly DEFAULT_NAME = "_default"; readonly scope: Scope; readonly name: C; readonly conn: CppConnection; readonly kvScanTimeout: number; readonly scanBatchItemLimit: number; readonly scanBatchByteLimit: number; /** @internal */ constructor(scope: Scope, collectionName: C); /** @internal */ get cluster(): Cluster; getKeyspace(): { bucket: B; scope: S; collection: C; }; getKeyspacePath(): `${string}.${string}.${string}`; /** @internal */ get transcoder(): Transcoder; /** @internal */ _mutationTimeout(durabilityLevel?: DurabilityLevel): number; /** * @internal */ getDocId(key: string): CppDocumentId; /** * Invokes a C++ core KV binding function while creating, populating and ending * the observability span (and recording the operation metric) for the call. * * It rejects with the raw {@link CppError} — exactly like the previous * `promisify` calls — so each operation keeps its existing `errorFromCpp` * error handling unchanged. * * @internal */ private _observeKvCall; private encodeSubDocument; private decodeSubDocument; get['Key'], Doc extends DocDefMatchingKey['Body'], WithExpiry extends boolean = false, ThrowIfMissing extends boolean = true>(key: Key, callbackOrOptions?: GetOptions | NodeCallback>): Promise>; get['Key'], Doc extends DocDefMatchingKey['Body'], WithExpiry extends boolean = false, ThrowIfMissing extends boolean = true>(key: Key, options: GetOptions, callback: NodeCallback>): Promise>; private _projectedGet; /** * Checks whether a specific document exists or not. * * @param key The document key to check for existence. * @param callback A node-style callback to be invoked after execution. */ exists['Key']>(key: Key, callback?: NodeCallback): Promise; /** * Checks whether a specific document exists or not. * * @param key The document key to check for existence. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ exists['Key']>(key: Key, options: ExistsOptions, callback?: NodeCallback): Promise; /** * @internal */ private _getReplica; /** * Retrieves the value of the document from any of the available replicas. This * will return as soon as the first response is received from any replica node. * * @overload * @param key The document key to retrieve. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getAnyReplica['Key'], Def extends DocDefMatchingKey, ThrowIfMissing extends boolean = true>(key: Key, options: GetAnyReplicaOptions, callback?: NodeCallback>): Promise>; /** * Retrieves the value of the document from any of the available replicas. This * will return as soon as the first response is received from any replica node. * * @overload * @param key The document key to retrieve. * @param callbackOrOptions A node-style callback to be invoked after execution. */ getAnyReplica['Key'], Def extends DocDefMatchingKey, ThrowIfMissing extends boolean = true>(key: Key, callbackOrOptions?: GetAnyReplicaOptions | NodeCallback>): Promise>; getAllReplicas['Key'], Def extends DocDefMatchingKey>(key: Key, callbackOrOptions?: GetAllReplicasOptions | NodeCallback<[GetReplicaResult, ...GetReplicaResult[]]>): StreamableReplicasPromise<[ GetReplicaResult, ...GetReplicaResult[] ], GetReplicaResult>; /** * Retrieves the value of the document from all available replicas. Note that * as replication is asynchronous, each node may return a different value. * * @param key The document key to retrieve. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getAllReplicas['Key'], Def extends DocDefMatchingKey>(key: Key, options: GetAllReplicasOptions, callback?: NodeCallback<[ GetReplicaResult, ...GetReplicaResult[] ]>): StreamableReplicasPromise<[ GetReplicaResult, ...GetReplicaResult[] ], GetReplicaResult>; /** * Inserts a new document to the collection, failing if the document already exists. * * @param key The document key to insert. * @param value The value of the document to insert. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ insert['Key'], Def extends DocDefMatchingKey>(key: Key, value: Def['Body'], options: InsertOptions, callback?: NodeCallback): Promise; insert['Key'], Def extends DocDefMatchingKey>(key: Key, value: Def['Body'], callback?: NodeCallback): Promise; /** * Upserts a document to the collection. This operation succeeds whether or not the * document already exists. * * @param key The document key to upsert. * @param value The new value for the document. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ upsert['Key'], Def extends DocDefMatchingKey>(key: Key, value: Def['Body'], options: UpsertOptions, callback?: NodeCallback): Promise; upsert['Key'], Def extends DocDefMatchingKey>(key: Key, value: Def['Body'], callback?: NodeCallback): Promise; /** * Replaces the value of an existing document. Failing if the document does not exist. * * @param key The document key to replace. * @param value The new value for the document. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ replace['Key'], Def extends DocDefMatchingKey>(key: Key, value: Def['Body'], options: ReplaceOptions, callback?: NodeCallback): Promise; replace['Key'], Def extends DocDefMatchingKey>(key: Key, value: Def['Body'], callback?: NodeCallback): Promise; /** * Remove an existing document from the collection. * * @param key The document key to remove. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ remove['Key']>(key: Key, options: RemoveOptions, callback?: NodeCallback): Promise; remove['Key']>(key: Key, callback?: NodeCallback): Promise; /** * Retrieves the value of the document and simultaneously updates the expiry time * for the same document. * * @param key The document to fetch and touch. * @param expiry The new expiry to apply to the document. * The expiry can be provided as: * - A `number` of seconds relative to the current time. * - A `Date` object for an absolute expiry time. * * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ). * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getAndTouch['Key'], Def extends DocDefMatchingKey>(key: Key, expiry: number | Date, options: GetAndTouchOptions, callback?: NodeCallback>): Promise>; getAndTouch['Key'], Def extends DocDefMatchingKey>(key: Key, expiry: number | Date, callback?: NodeCallback>): Promise>; /** * Updates the expiry on an existing document. * * @param key The document key to touch. * @param expiry The new expiry to apply to the document. * The expiry can be provided as: * - A `number` of seconds relative to the current time. * - A `Date` object for an absolute expiry time. * * **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ). * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ touch['Key']>(key: Key, expiry: number | Date, options: TouchOptions, callback?: NodeCallback>): Promise>; touch['Key']>(key: Key, expiry: number | Date, callback?: NodeCallback>): Promise>; /** * Locks a document and retrieves the value of that document at the time it is locked. * * @param key The document key to retrieve and lock. * @param lockTime The amount of time to lock the document for, specified in seconds. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ getAndLock['Key'], Def extends DocDefMatchingKey>(key: Key, lockTime: number, options: GetAndLockOptions, callback?: NodeCallback>): Promise>; getAndLock['Key'], Def extends DocDefMatchingKey>(key: Key, lockTime: number, callback?: NodeCallback>): Promise>; /** * Unlocks a previously locked document. * * @param key The document key to unlock. * @param cas The CAS of the document, used to validate lock ownership. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ unlock['Key']>(key: Key, cas: CasInput, options: UnlockOptions, callback?: VoidNodeCallback): Promise; unlock['Key']>(key: Key, cas: CasInput, callback?: VoidNodeCallback): Promise; /** * @internal */ _continueScan(iterator: CppScanIterator, transcoder: Transcoder, emitter: StreamableScanPromise): void; /** * @internal */ _doScan(scanType: RangeScan | SamplingScan | PrefixScan, options: CppRangeScanOrchestratorOptions, transcoder: Transcoder, callback?: NodeCallback): StreamableScanPromise; /** * Performs a key-value scan operation. * * Use this API for low concurrency batch queries where latency is not a critical as the system * may have to scan a lot of documents to find the matching documents. * For low latency range queries, it is recommended that you use SQL++ with the necessary indexes. * * @param scanType The type of scan to execute. * @param options Optional parameters for the scan operation. * @param callback A node-style callback to be invoked after execution. */ scan>(scanType: RangeScan | SamplingScan | PrefixScan, options: ScanOptions, callback?: NodeCallback[]>): StreamableScanPromise[], ScanResult>; scan>(scanType: RangeScan | SamplingScan | PrefixScan, callback?: NodeCallback[]>): StreamableScanPromise[], ScanResult>; lookupIn, SpecDefinitions, ThrowOnSpecError extends boolean = false>(key: Key, specs: NarrowLookupSpecs, ExtractCollectionJsonDocDef, Key>, SpecDefinitions>, options: LookupInOptions, callback?: NodeCallback, SpecDefinitions, ExtractCollectionJsonDocDef, Key>>, ThrowOnSpecError>>): Promise, 'lookupIn', SpecDefinitions, ExtractCollectionJsonDocDef, Key>, ThrowOnSpecError>>; lookupIn, SpecDefinitions, ThrowOnSpecError extends boolean = false>(key: Key, specs: NarrowLookupSpecs, ExtractCollectionJsonDocDef, NoInfer>, SpecDefinitions>, callback?: NodeCallback, SpecDefinitions, ExtractCollectionJsonDocDef, NoInfer>>, ThrowOnSpecError>>): Promise, 'lookupIn', SpecDefinitions, ExtractCollectionJsonDocDef, Key>, ThrowOnSpecError>>; lookupIn, ThrowOnSpecError extends boolean = false>(key: Key, options?: LookupInOptions): ChainableLookupIn>; private _lookupIn; private _lookupInReplica; /** * Performs a lookup-in operation against a document, fetching individual fields or * information about specific fields inside the document value from any of the available * replicas in the cluster. * * @param key The document key to look in. * @param specs A list of specs describing the data to fetch from the document. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ lookupInAnyReplica, SpecDefinitions, ThrowOnSpecError extends boolean = false>(key: Key, specs: NarrowLookupSpecs, CollectionDocDefMatchingKey, SpecDefinitions>, options: LookupInAnyReplicaOptions, callback?: NodeCallback, 'lookupInAnyReplica', SpecDefinitions, CollectionDocDefMatchingKey, ThrowOnSpecError>>): Promise, 'lookupInAnyReplica', SpecDefinitions, CollectionDocDefMatchingKey, ThrowOnSpecError>>; lookupInAnyReplica, SpecDefinitions, ThrowOnSpecError extends boolean = false>(key: Key, specs: NarrowLookupSpecs, CollectionDocDefMatchingKey, SpecDefinitions>, callback?: NodeCallback, 'lookupInAnyReplica', SpecDefinitions, CollectionDocDefMatchingKey, ThrowOnSpecError>>): Promise, 'lookupInAnyReplica', SpecDefinitions, CollectionDocDefMatchingKey, ThrowOnSpecError>>; lookupInAnyReplica, ThrowOnSpecError extends boolean = false>(key: Key, options?: LookupInAnyReplicaOptions): ChainableLookupIn>; /** * Performs a lookup-in operation against a document, fetching individual fields or * information about specific fields inside the document value from all available replicas. * Note that as replication is asynchronous, each node may return a different value. * * @param key The document key to look in. * @param specs A list of specs describing the data to fetch from the document. * @param options Optional parameters for this operation. * @param callback A node-style callback to be invoked after execution. */ lookupInAllReplicas, SpecDefinitions, ThrowOnSpecError extends boolean = false>(key: Key, specs: NarrowLookupSpecs, CollectionDocDefMatchingKey, SpecDefinitions>, options: LookupInAllReplicasOptions, callback?: NodeCallback, SpecDefinitions, CollectionDocDefMatchingKey>, ThrowOnSpecError>[]>): Promise, SpecDefinitions, CollectionDocDefMatchingKey>, ThrowOnSpecError>[]>; lookupInAllReplicas, SpecDefinitions, ThrowOnSpecError extends boolean = false>(key: Key, specs: NarrowLookupSpecs, CollectionDocDefMatchingKey, SpecDefinitions>, callback?: NodeCallback, SpecDefinitions, CollectionDocDefMatchingKey>, ThrowOnSpecError>[]>): Promise, SpecDefinitions, CollectionDocDefMatchingKey>, ThrowOnSpecError>[]>; lookupInAllReplicas, ThrowOnSpecError extends boolean = false>(key: Key, options?: LookupInAllReplicasOptions): ChainableLookupIn>; mutateIn, Def extends DocDefMatchingKey, SpecDefinitions extends ReadonlyArray>(key: Key, specsOrOptions?: MutateInOptions | NarrowMutationSpecs, Def, SpecDefinitions>, optionsOrCallback?: MutateInOptions | NodeCallback>>>, callback?: NodeCallback>>>): MutateInReturnType; private _mutateIn; /** * Returns a CouchbaseList permitting simple list storage in a document. * * @param key The document key the data-structure resides in. */ list, T, B, S, C>['Key']>(key: Key): CollectionListReturn; /** * Returns a CouchbaseQueue permitting simple queue storage in a document. * * @param key The document key the data-structure resides in. */ queue, T, B, S, C>['Key']>(key: Key): CollectionQueueReturn; /** * Returns a CouchbaseMap permitting simple map storage in a document. * * @param key The document key the data-structure resides in. */ map, T, B, S, C>['Key'], Doc extends Extract['Body'], Record>, MapDoc extends If, Record, Doc>, R = IsNever>> extends true ? CouchbaseMap : this extends CollectionMatchingDocDef> ? CouchbaseMap : 'This collection does not contain any map.'>(key: Key): R; /** * Returns a CouchbaseSet permitting simple set storage in a document. * * @param key The document key the data-structure resides in. */ set, T, B, S, C>['Key']>(key: Key): CollectionSetReturn; /** * Returns a BinaryCollection object reference, allowing access to various * binary operations possible against a collection. */ binary(): BinaryCollection; /** * @internal */ _binaryIncrement(key: string, delta: number, options: IncrementOptions, callback?: NodeCallback): Promise; _binaryIncrement(key: string, delta: number, callback?: NodeCallback): Promise; /** * @internal */ _binaryDecrement(key: string, delta: number, options: DecrementOptions, callback?: NodeCallback): Promise; _binaryDecrement(key: string, delta: number, callback?: NodeCallback): Promise; /** * @internal */ _binaryAppend(key: string, value: string | Buffer, options: AppendOptions, callback?: NodeCallback): Promise; _binaryAppend(key: string, value: string | Buffer, callback?: NodeCallback): Promise; /** * @internal */ _binaryPrepend(key: string, value: string | Buffer, options: PrependOptions, callback?: NodeCallback): Promise; _binaryPrepend(key: string, value: string | Buffer, callback?: NodeCallback): Promise; /** * Returns a CollectionQueryIndexManager which can be used to manage the query indexes * of this collection. */ queryIndexes(): CollectionQueryIndexManager; } type CollectionSetReturn, S extends ScopeName, C extends CollectionName, Key extends DocDefMatchingBody, T, B, S, C>['Key']> = Extract['Body'], unknown[]> extends infer Doc ? IsNever extends true ? 'This collection does not contain any set.' : If, any, ArrayElement> extends infer Item ? CouchbaseSet : never : never; type CollectionListReturn, S extends ScopeName, C extends CollectionName, Key extends DocDefMatchingBody, T, B, S, C>['Key']> = Extract['Body'], unknown[]> extends infer Doc ? IsNever extends true ? 'This collection does not contain any list.' : If, any, ArrayElement> extends infer Item ? CouchbaseList : never : never; type CollectionQueueReturn, S extends ScopeName, C extends CollectionName, Key extends DocDefMatchingBody, T, B, S, C>['Key']> = Extract['Body'], unknown[]> extends infer Doc ? IsNever extends true ? 'This collection does not contain any queue.' : If, any, ArrayElement> extends infer Item ? CouchbaseQueue : never : never; type CollectionGetReturn = ThrowIfMissing extends true ? GetResult : GetResult | undefined; type CollectionGetAnyReplicaReturn = ThrowIfMissing extends true ? GetReplicaResult : GetReplicaResult | undefined; export {};