Skip to main content
Version: V1.1.0

get - Retrieve

The get() method is used to retrieve documents from a collection without performing vector similarity search.

It supports filtering by IDs, metadata, and document.

info

This API can only be used when connected with SeekdbClient. For more information about SeekdbClient, see SeekdbClient.

Prerequisites

Request parameters

get()
ParameterTypeRequiredDescriptionExample Value
idsstring | string[]YesThe ID or list of IDs to retrieve.['1', '2']
whereWhereNoMetadata filter conditions.{ category: 'science' }
whereDocumentWhereDocumentNoDocument filter conditions.{"$contains": "machine"}
limitnumberNoThe maximum number of results to return.{"category": {"$eq": "AI"}}
offsetnumberNoThe number of results to skip for pagination.{"$contains": "machine"}
includereadonly ("documents" | "metadatas" | "embeddings")[]NoThe list of fields to include: ["documents", "metadatas", "embeddings"].["documents", "metadatas", "embeddings"]
info

If no parameters are provided, all data is returned.

Request example

import { SeekdbClient } from "seekdb";

const client = new SeekdbClient({
host: "127.0.0.1",
port: 2881,
user: "root",
password: "",
database: "test",
});

const collection = await client.getCollection({name: 'my_collection'});

const result = await collection.get({
ids: ['1', '2']
});

Response parameters

  • If a single ID is provided: the response includes the get object for that ID.
  • If multiple IDs are provided: a list of QueryResult objects, one for each ID.
  • If filters are provided: a QueryResult object containing all matching results.