[SERVER-28177] query_request_helper::asAggregationCommand() should return an AggregationRequest, not a BSONObj Created: 02/Mar/17 Updated: 26/Jul/23 Resolved: 15/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc8 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | David Percy |
| Resolution: | Done | Votes: | 0 |
| Labels: | read-only-views | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||
| Backport Requested: |
v7.0
|
||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Linked BF Score: | 35 | ||||||||||||||||||||||||
| Description |
|
Since a view is defined by an aggregation pipeline, we convert any count, distinct, or find command request to an equivalent aggregation command. For the find command, this is accomplished with query_request_helper::asAggregationCommand(). Currently this returns a BSONObj, which we almost always parse immediately into an AggregationRequest. For performance and simplicity, we should change these methods to return a StatusWith<AggregationRequest> directly. Also, if the caller always uses uassertStatusOK on the result, we can further simplify by returning AggregationRequest directly, and throwing an exception in the error case. |
| Comments |
| Comment by Githook User [ 15/Jul/23 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: When we get a find request on a view, we first translate it to an |
| Comment by Githook User [ 15/Jul/23 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: When we get a find request on a view, we first translate it to an |
| Comment by David Percy [ 11/Jul/23 ] |
|
Previously this ticket was about all 3 commands: find, count, distinct. I've split off SERVER-78874 and SERVER-78875 to handle count and distinct, and narrowed this ticket to be only about 'find'. |
| Comment by Xin Hao Zhang (Inactive) [ 04/Jun/19 ] |
|
|