Documentation
Namespaces
Datastore
interfaces
Opts

Interface: Opts<DocMeta, Filter>

Options for creating a Datastore instance.

Extended By

Type parameters

Parameter
DocMeta extends BaseMeta
Filter extends BaseFilter<DocMeta>

Properties

PropertyTypeDescriptionSource
cache?CacheStorage<string, QueryResult<DocMeta>>Enables caching for queries. Must implement .get(key) and .set(key, value), both of which can be either sync or async.

Some examples include: new Map(), quick-lru (opens in a new tab), or any keyv adaptor (opens in a new tab).
src/datastore/types.ts:95 (opens in a new tab)
cacheKey?CacheKey<Query<DocMeta, Filter>, string>A function that returns a cache key for the given params.

A simple example would be: (params) => JSON.stringify(params)

The default cacheKey function uses hash-object (opens in a new tab) to create a stable sha256 hash of the params.
src/datastore/types.ts:89 (opens in a new tab)
contentKeykeyof DocMetaThe metadata key of the content that is embedded.
The value associated with the key must be a string.
src/datastore/types.ts:79 (opens in a new tab)
context?Ctx-src/datastore/types.ts:97 (opens in a new tab)
debug?booleanWhether or not to add default console.log event handlerssrc/datastore/types.ts:99 (opens in a new tab)
embeddingModelEmbeddingModel-src/datastore/types.ts:81 (opens in a new tab)
events?Events<DocMeta, Filter>-src/datastore/types.ts:96 (opens in a new tab)
namespace?string-src/datastore/types.ts:80 (opens in a new tab)