Deleting Data
Remove records by key, filter pipeline, or drop entire streams.
Delete by Key
Removes a single record by its key. Uses the in-memory index for an O(log n) lookup — no segment scan required.
from("users").delete("user_102")
Deletion is soft: a tombstone frame is appended to the log. The record is excluded from all future queries, and its space is reclaimed during compaction.
Pipeline Delete
Delete all records matching a filter pipeline:
from("users") | filter(status == "inactive") .delete()
The pipeline selects matching records, then tombstone frames are appended atomically under the write lock.
Empty a Stream
Remove all records from a stream while keeping the stream itself alive:
from("logs").empty()
Useful for clearing ephemeral data (e.g., temporary caches, session stores) without dropping the stream schema.
Drop a Stream
Completely remove a stream and all its records. The stream will no longer appear in streams() listings:
drop("old_metrics_2025")
This is an administrative action. All segments for the stream are tombstoned and the stream is removed from the active set.