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?
Recommended threads
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- Cloud function deploy stucks in processi...
Been trying for the last hours to deploy my function but for whatever reason, alwasy stuck on processing!
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...