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
Also, what is the point of sorting in this case? If anything, shouldn't the results be sorted by the order they are in the template (which, depending on the language you're using, may be indeterministic).
The text was updated successfully, but these errors were encountered:
As you mentioned, JSON data structures do not define an order on keys in an object, so it's impossible to order conditions as they were given in the template. But, we want the behavior to be deterministic. So the only alternative is to sort them.
This was kind of a flaw in $match, which IIRC is why $switch was introduced. $switch enforces that at most one arm matches, so the order in which they are checked does not matter.
The docs for
$match
does say anything about sorting, and yet there is this test:Also, what is the point of sorting in this case? If anything, shouldn't the results be sorted by the order they are in the template (which, depending on the language you're using, may be indeterministic).
The text was updated successfully, but these errors were encountered: