Skip to content
3 min read · 663 words

Class: CouchbaseVectorStore ​

Defined in: src/batteries/vector/couchbase/index.ts:118

Abstract base shared by every bundled vector adapter. It implements the cross-cutting surface (query/schema/transaction/asCallable/encode) on top of the small set of backend-specific abstract methods each adapter fills in (connect, executeSearch, createCollection, …). Concrete adapters inherit the doc comments below unless they override them.

Extends ​

Constructors ​

Constructor ​

ts
new CouchbaseVectorStore(options: BaseVectorStoreOptions): CouchbaseVectorStore;

Defined in: src/batteries/vector/contract.ts:60

Parameters ​

ParameterType
optionsBaseVectorStoreOptions

Returns ​

CouchbaseVectorStore

Inherited from ​

BaseVectorStore.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
capabilitiesreadonlyVectorStoreCapabilitiesStatic description of what this backend supports — see VectorStoreCapabilities.BaseVectorStore.capabilitiessrc/batteries/vector/couchbase/index.ts:119

Accessors ​

schema ​

Get Signature ​

ts
get schema(): VectorSchemaBuilder;

Defined in: src/batteries/vector/contract.ts:109

Schema builder bound to this store, for creating/dropping/migrating collections.

Returns ​

VectorSchemaBuilder

Inherited from ​

BaseVectorStore.schema

Methods ​

asCallable() ​

ts
asCallable(): CallableVectorStore;

Defined in: src/batteries/vector/contract.ts:123

Wrap this store in a callable proxy so store('collection') is shorthand for store.query('collection'), while all other methods/properties pass through unchanged.

Returns ​

CallableVectorStore

Inherited from ​

BaseVectorStore.asCallable


close() ​

ts
close(): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:174

Release the backing connection and any held resources.

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.close


connect() ​

ts
connect(): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:161

Establish the backing connection (open clients, pools, sockets). Idempotent where the driver allows.

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.connect


createCollection() ​

ts
createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:195

Create a collection from spec; a no-op when ifNotExists and it already exists.

Parameters ​

ParameterType
specCollectionSpec
ifNotExistsboolean

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.createCollection


dropCollection() ​

ts
dropCollection(collection: string, ifExists: boolean): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:311

Drop a collection; a no-op when ifExists and it is absent.

Parameters ​

ParameterType
collectionstring
ifExistsboolean

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.dropCollection


executeDelete() ​

ts
executeDelete(plan: DeletePlan): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:560

Execute a compiled delete plan.

Parameters ​

ParameterType
planDeletePlan

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.executeDelete


executeSearch() ​

ts
executeSearch(plan: SearchPlan): Promise<VectorMatch[]>;

Defined in: src/batteries/vector/couchbase/index.ts:438

Execute a compiled search plan and return the matched records.

Parameters ​

ParameterType
planSearchPlan

Returns ​

Promise<VectorMatch[]>

Overrides ​

BaseVectorStore.executeSearch


executeUpsert() ​

ts
executeUpsert(plan: UpsertPlan): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:374

Execute a compiled upsert plan (insert-or-replace the given records).

Parameters ​

ParameterType
planUpsertPlan

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.executeUpsert


hasCollection() ​

ts
hasCollection(collection: string): Promise<boolean>;

Defined in: src/batteries/vector/couchbase/index.ts:356

Whether a collection currently exists in the backend.

Parameters ​

ParameterType
collectionstring

Returns ​

Promise<boolean>

Overrides ​

BaseVectorStore.hasCollection


isAvailable() ​

ts
isAvailable(): boolean;

Defined in: src/batteries/vector/couchbase/index.ts:157

Whether the backend's optional peer dependency is installed and the store is usable.

Returns ​

boolean

Overrides ​

BaseVectorStore.isAvailable


query() ​

ts
query(collection: string): VectorQueryBuilder;

Defined in: src/batteries/vector/contract.ts:114

Open a VectorQueryBuilder scoped to collection (default top-K of 10).

Parameters ​

ParameterType
collectionstring

Returns ​

VectorQueryBuilder

Inherited from ​

BaseVectorStore.query


renameCollection() ​

ts
renameCollection(_from: string, _to: string): Promise<void>;

Defined in: src/batteries/vector/couchbase/index.ts:370

Rename a collection from from to to.

Parameters ​

ParameterType
_fromstring
_tostring

Returns ​

Promise<void>

Overrides ​

BaseVectorStore.renameCollection


transaction() ​

ts
transaction(_fn: (tx: CallableVectorStore) => Promise<void>): Promise<void>;

Defined in: src/batteries/vector/contract.ts:104

Run fn inside a backend transaction. The base implementation rejects with E_VECTOR_STORE_TRANSACTIONS_UNSUPPORTED; adapters whose backend supports transactions override this.

Parameters ​

ParameterType
_fn(tx: CallableVectorStore) => Promise<void>

Returns ​

Promise<void>

Inherited from ​

BaseVectorStore.transaction


isAvailable() ​

ts
static isAvailable(): boolean;

Defined in: src/batteries/vector/couchbase/index.ts:153

Static availability probe: whether this adapter's runtime driver can load in the current environment.

Returns ​

boolean