Skip to main content
Learn how to remove documents from your VectoriaDB index.

Remove Single Document

src/remove-single.ts

Remove Multiple Documents

src/remove-multiple.ts

Clear All Documents

src/clear-all.ts
clear() is irreversible and removes all documents. Make sure to save important data before calling it.

Remove by Filter

VectoriaDB doesn’t have a built-in “remove by filter” method. Use this pattern:
src/remove-by-filter.ts

Safe Removal Pattern

src/safe-remove.ts

HNSW Index Updates

When using HNSW indexing, remove operations update the index structure:
src/hnsw-remove.ts

Storage Considerations

Removing documents doesn’t automatically update persistent storage:
src/remove-with-storage.ts
For file or Redis storage, call saveToStorage() after batch removals to persist the changes.

Adding Documents

Add documents

Updating Documents

Update documents

Storage

Persist changes