Deletes documents from the vector store or deletes the entire index.
Embedded
Python SDK
JS/TS
delete(
ids: Optional[List[str]] = None,
delete_index: bool = False
) -> bool
Parameters
| Parameter | Type | Description |
|---|
ids | Optional[List[str]] | (Optional) List of document IDs to delete |
delete_index | bool | If True, deletes the entire index regardless of ids (default: False) |
Returns
bool: True if deletion was successful, False otherwiseExample Usage
# Delete specific documents
doc_ids = ["doc1", "doc2", "doc3"]
success = store.delete(ids=doc_ids)
if success:
print("Documents deleted successfully")
# Delete the entire index
success = store.delete(delete_index=True)
if success:
print("Index deleted successfully")
delete(
ids: Optional[List[str]] = None,
delete_index: bool = False
) -> bool
Parameters
| Parameter | Type | Description |
|---|
ids | Optional[List[str]] | (Optional) List of document IDs to delete |
delete_index | bool | If True, deletes the entire index regardless of ids (default: False) |
Returns
bool: True if deletion was successful, False otherwiseExample Usage
# Delete specific documents
success = store.delete(ids=["doc1", "doc2"])
# Delete the entire index
success = store.delete(delete_index=True)
delete(params: { ids?: string[] }): Promise<void>
Parameters
| Parameter | Type | Description |
|---|
params.ids | string[] | (Optional) Array of document IDs to delete |
Returns
Promise<void>: Resolves on success, throws on failureThe JS/TS SDK does not support the delete_index parameter. To delete an entire index, use the CyborgDB service client directly.
Unlike the Python SDKs which return bool, the JS/TS method returns void and throws an error on failure.
Example Usage
// Delete specific documents
await store.delete({ ids: ["doc1", "doc2", "doc3"] });
Async
The Embedded and Python SDK provide async versions of this method prefixed with a:# adelete — async variant
success = await store.adelete(ids=["doc1", "doc2"])
JS/TS methods are natively async — all signatures above already return Promise<...>. No separate async variant is needed.