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
reorderwithout arguments is ignored inside scopes when there is a default scope. However, with arguments will work as expected. In order words, there seems to be no way to clear a sort entirely from within a scope lambda expression. For example:
The problem is scopes are criteria that gets merged with the existing criteria. In this case, the reorder by itself is ignored if there are no conditions. Something like .reorder(nil) to force it to clear the pre-existing order might be useful here.
reorder
without arguments is ignored inside scopes when there is a default scope. However, with arguments will work as expected. In order words, there seems to be no way to clear a sort entirely from within a scope lambda expression. For example:then
This is important in some cases when using indexes, sometimes a sort will cause MongoDB to skip using an index when using complex expressions.
The text was updated successfully, but these errors were encountered: