Rank 2: Process
Dear all,
I have a query that fetches all records from a collection. Now, these records have a Featured Expiry Timestamp, that marks the date when their 'pro' status expires.
Now, I want to fetch the list of records ordered by the expiry timestamp ascending, so that those which are expiring soon will be at the top.
simply doing a Query.orderAsc('timestamp') will also fetch those which have their pro status expired. I just want the ones expiring soon to feature first.
Of course, Query.greaterThan('timestamp', Date.now().toString()) will not work in my scenario since I still want the expired ones to feature after the ones with pro status
My idea is to do these 2 queries each time and merge the results, however, I was wondering if there is a more efficient way. However, it might affect my pagination badly.
What is the best way to approach this?