Skip to main content
Remove documents from the vector database.

remove()

Remove a single document.

Signature

Parameters

Return Value

Returns true if the document was found and removed, false otherwise.

Example


removeMany()

Remove multiple documents.

Signature

Parameters

Return Value

Returns the count of documents actually removed.

Example


clear()

Remove all documents from the database.

Signature

Example

clear() removes all documents from memory. Use clearStorage() to also clear persisted data.

HNSW Behavior

When using HNSW indexing, remove operations update the index structure automatically:

Storage Considerations

Removing documents doesn’t automatically update persistent storage:

add()

Add documents

update()

Update documents

clearStorage()

Clear storage