How to query StorageIndexList to find storage objects that have expired?

I’ve got StorageIndexList indexing my storage collection and queries on my fields work fine. Is the creation time of the storage objects automatically indexed and if so, can you show me what to use as a query string to return a list of objects that were created more than a week ago so I can delete them ?

Hello @Spuddy,

This is documented in the query syntax section of the docs (however the key is create_time for the storage indices).

Adding the following to the query will work:

+create_time:<"2024-05-10"

You should programmatically infer the date threshold as a week from <current_time> and pass it in the format above (the date can be more granular, see the example in the docs that includes time as well).

Hope this helps,

Best.