-
Type:
Task
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Querying
-
Query Optimization
-
Fully Compatible
-
v7.0
-
35
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.
- is related to
-
SERVER-78875 ParsedDistinct::asAggregationCommand() should return an AggregationRequest, not a BSONObj
-
- Open
-
-
SERVER-78874 CountRequest::asAggregationCommand() should return an AggregationRequest, not a BSONObj
-
- Backlog
-