Skip to main content

delete

Deletes vectors based on the provided IDs.

delete(ids: string[]): Promise<number>;

Reference

import { myVectorStore } from "#elements";
export default async function () {
const count = await myVectorStore.delete(["1", "2", "3"]);
console.log(`${count} vectors deleted`);
}

Parameters

  • ids: An array of IDs of the vectors to delete.

Returns

Promise of the number of vectors deleted.

Caveats

  • If an item for an ID does not exist in the vector store, the deletion of that ID is ignored.
  • If the ids array is empty, then nothing will be done.