-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Query Execution
-
Fully Compatible
-
(copied to CRM)
SERVER-23654 introduced the $facet stage, which combines all outputs of the sub-pipelines into one result document. This is a request to enable some mechanism for returning more than 16MB of results, while still being able to process the same initial result set in multiple ways.
Original Request
I have several similar aggregation operations at the same time, for example
db.cases.aggregate([ {$match : query}, {$unwind : "factors"}, //operation 1 of the above result // ... ]) db.cases.aggregate([ {$match : query}, {$unwind : "factors"}, //operation 2 of the above result // ... ])
The first two stages of aggregation( $match, $unwind ) are the same, and I think it would be a waste to repeat the duplicate stages. So I am asking if there exists a way to forking the pipeline, so that it can share the result from the first two stages, as follows,
db.cases.aggregation([ {$match : query}, {$unwind : "factors"}, forks : [ {... operation 1}, {... operation 2} ] ])
http://stackoverflow.com/questions/38047527/fork-the-pipeline-of-aggregation
- is duplicated by
-
SERVER-35641 $FACET throws "BufBuilder attempted to grow()" while
- Closed