Skip to main content
Delete individual points or batches of points from your collection. Deleted points can be recovered only before you compact the collection.
You need an existing collection with points. See Insert points to add data first.

Delete a single point

The following example removes a single point by ID.

Delete multiple points

Deleting a nonexistent point does not cause an error — the operation completes successfully regardless of whether the point exists. The following example removes multiple points at once.

Compact a collection

After deleting points, run a compaction operation to reclaim storage space and optimize the index. The compact() method is an alias for optimize(). Compaction permanently removes deleted points from storage, rebuilds the index structure, and reclaims disk space. Run compaction after large-scale deletions to maintain optimal performance.
Compaction is a resource-intensive operation that may temporarily impact collection performance. Run during low-traffic periods when possible.