Purging Kv keys
I have a logger which write logs to a kv store with dual keys, something like
So far all is well.. But a problem pups up when i want to purge all logs before a specific start time, i could loop through all processes, deleting using this selector:
But as end-users can add/delete processes over time, i cannot be sure i known which processes exist in history, so i would need to use a wildcard, like:
Any idéas on how to make this happen efficiently, without looping over all possible keys?
Actual, non-functioning code:
https://github.com/Hexagon/pup/blob/afd8d3f3b292c8e317d21dea9c7d0509f1e40d59/lib/core/logger.ts#L236
So far all is well.. But a problem pups up when i want to purge all logs before a specific start time, i could loop through all processes, deleting using this selector:
But as end-users can add/delete processes over time, i cannot be sure i known which processes exist in history, so i would need to use a wildcard, like:
Any idéas on how to make this happen efficiently, without looping over all possible keys?
Actual, non-functioning code:
https://github.com/Hexagon/pup/blob/afd8d3f3b292c8e317d21dea9c7d0509f1e40d59/lib/core/logger.ts#L236
