I’m in real need of filtering keys by date, but I’m unable to figure out a clever way to use the prefix to filter between start and end range.
Anyone have any ideas on how to hack this?
EDIT: Figured it out!
Since prefix is text-based it will filter everything that it starts with, but we need some number logic to make sense of it in the KV.
Say we have a key with a March date:
Then we just use the prefix filter:
…to get everything that’s from march and forward.
We also want the end date, so…
Say we have a key value of:
Entering the prefix:
Will give us all keys from March to July.
The same logic applies to days.