Skip to main content

getDocuments

client.vectorDb.getDocuments(id: string, params?: Record<string, unknown>): Promise<VectorDocument[]>

Retrieves documents from a vector collection.

Fetches documents stored in the collection with optional filtering and pagination parameters. Use this to inspect stored content or retrieve specific documents by criteria.

Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the collection
paramsRecord<string, unknown>NoOptional query parameters for filtering or pagination

Returns

Promise<VectorDocument[]> — A promise that resolves to an array of VectorDocument objects

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.vectorDb.getDocuments('id');
console.log(result);