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
- Unable to add user preferences within au...
When i click on the add preference button nothing happens. There are other buttons within the page which seem unresponsive, including the multi-authentication t...
- cli broke with new varchar type??
``` appwrite types ./appwritetypes ℹ Info: Detected language: ts ℹ Info: Directory: ./...
- Substring lookup for array elements
Hello, Is substring look up possible for array of strings? ```js Query.contains('product_names', [chair]), ``` this only works if I have the exact item name. `...