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
Describe the bug
As #414 and #527 were closed without any interaction by a stale bot (yay...) here another attempt.
When using DBRefs/Links, the ordering is stable when using MongoDB directly or any of its lower level libraries.
This is however not always the case with beanie.
Upon insert/update the order is preserved, as defined.
Upon link-fetching via e.g. fetch_links or fetch_all_links, it is not.
A possible solution can be found here: #414 (comment)
This just copies all Ids to a list with the original order and sorts the fetched documents later based on this order.
To Reproduce
Examples can be found in both older issues.
Expected behavior
Using fetch_all_links and fetch_links keeps the order of items as defined as DBRefs in the database.
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
As #414 and #527 were closed without any interaction by a stale bot (yay...) here another attempt.
When using DBRefs/Links, the ordering is stable when using MongoDB directly or any of its lower level libraries.
This is however not always the case with beanie.
Upon insert/update the order is preserved, as defined.
Upon link-fetching via e.g.
fetch_links
orfetch_all_links
, it is not.A possible solution can be found here: #414 (comment)
This just copies all Ids to a list with the original order and sorts the fetched documents later based on this order.
To Reproduce
Examples can be found in both older issues.
Expected behavior
Using
fetch_all_links
andfetch_links
keeps the order of items as defined as DBRefs in the database.Additional context
The text was updated successfully, but these errors were encountered: