You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.
Reverse ordering with RAD currently doesn't work: amark/gun#1011
We currently have a function that aims to retrieve documents in reverse order. Current behaviour is no different than forward order; the '-' key value does not modify the behaviour as expected.
user.get('timestamps').get({'.': {'<': newDate().getTime(),'-': true},'%': 100000}).map().get('modifiedAt').map().once(async(document)=>{// do something with document})
How does this affect us? Pagination cannot be used, and retrieval of data by time cannot be depended upon. The only present alternative I'm aware of is to fall back on relative ordering, such as in the basketball example: https://gun.eco/explainers/basketball/basketball.html This however does not guarantee properly sequenced data if we implement pagination.
Another alternative is to query in ranges, like so:
And we could iterate backwards through paired time values, saving the previous '>' value in memory for Nth iteration.
NOTE: This is how pagination is roughly supposed to work anyway, albeit with a substitute '<' value instead based on the last retrieved index.
To ensure retrieval of all documents, however, we would have to iterate forwards through '>' time values based on previously retrieved keys, THEN when no more are returned decrease both values to the next block of time and repeat that process.
It would work... but let us hope that upstream is fixed before we've need to implement that. 😅
The text was updated successfully, but these errors were encountered:
Reverse ordering with RAD currently doesn't work: amark/gun#1011
We currently have a function that aims to retrieve documents in reverse order. Current behaviour is no different than forward order; the
'-'
key value does not modify the behaviour as expected.How does this affect us? Pagination cannot be used, and retrieval of data by time cannot be depended upon. The only present alternative I'm aware of is to fall back on relative ordering, such as in the basketball example: https://gun.eco/explainers/basketball/basketball.html This however does not guarantee properly sequenced data if we implement pagination.
Another alternative is to query in ranges, like so:
And we could iterate backwards through paired time values, saving the previous '>' value in memory for Nth iteration.
NOTE: This is how pagination is roughly supposed to work anyway, albeit with a substitute '<' value instead based on the last retrieved index.
To ensure retrieval of all documents, however, we would have to iterate forwards through '>' time values based on previously retrieved keys, THEN when no more are returned decrease both values to the next block of time and repeat that process.
It would work... but let us hope that upstream is fixed before we've need to implement that. 😅
The text was updated successfully, but these errors were encountered: