Skip to main content
Learn how to update documents in your VectoriaDB index.

Update Metadata Only

Metadata-only updates are instant and don’t trigger re-embedding:
src/update-metadata.ts
Use updateMetadata when only changing metadata fields. It’s significantly faster than a full update since no embedding regeneration is required.

Update Text and Metadata

When text changes, VectoriaDB re-embeds the document:
src/update-document.ts

Smart Re-embedding

The update method only re-embeds when necessary:
src/smart-update.ts

Batch Updates

src/batch-update.ts

Return Value

updateMany returns statistics:
  • updated: Total documents updated
  • reembedded: Documents that required re-embedding

Upsert Pattern

VectoriaDB doesn’t have a built-in upsert. Use this pattern:
src/upsert.ts

Partial Metadata Updates

To update only some metadata fields:
src/partial-update.ts

Error Handling

src/update-errors.ts

Adding Documents

Add new documents

Removing Documents

Remove documents

Search

Query updated documents