[DOCS-13808] [Server] Make documentation about order of operations in find() more clear Created: 04/Aug/20 Updated: 22/Jan/24 |
|
| Status: | Backlog |
| Project: | Documentation |
| Component/s: | manual, Server |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | backlog, feature, query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Days since reply: | 3 years, 27 weeks, 1 day ago | ||||||||
| Epic Link: | DOCSP-11702 | ||||||||
| Description |
DescriptionThe find() command generally behaves as if the components of the query are performed in the following order: match -> sort -> skip -> limit -> project This can lead to very confusing behavior, given that users can construct queries in any order. Similar issues can come up with projection and sort. For example:
In this case the sort will actually be applied on 'newField' before applying the projection. A user ran into this in This can also come up with limit and sort. For example:
will perform the limit after the sort, even though the limit was specified first. We should update a few of the documentation pages about find() to discuss this. There is already a note about it here, but we should add a note under the new projection functionality here. It would also be good to specify the full order of operations in the find command page, and perhaps the find() shell helper page. The wording for this will be a bit tricky because, as mentioned, the query is executed as if the operations were performed in the order listed above. Our optimization code is free re-order the components as long as it doing so does not alter the semantics of the query. Scope of changesImpact to Other DocsMVP (Work and Date)Resources (Scope or Design Docs, Invision, etc.) |