deletePrefix
Deletes every key beginning with prefix, and returns how many.
val retired = db.deletePrefix(Key.of("session/2026-07/"))
db.compact() // as deleteRange: tombstones are reclaimed by compaction, not by this callContent copied to clipboard
Retention by namespace rather than by range, for a store that keys by owner or by tenant. It delegates to DocumentStore.deletePrefix unchanged.
Not spellable as deleteRange, which is why it is here. [from, to] is inclusive at both ends and a prefix's upper end is exclusive, so the range a caller reaches for — the prefix with its last byte raised — retires one key too many, and the extra key is the first one in the neighbouring namespace. Key.startsWith carries the argument.