-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
Query Optimization
It would be nice if we could exit out of an Aggregate Pipeline. For example:
db.books.aggregate([ {$match:{ _id: ObjectId('5bede977e8dd7e5d5df79dab') }}, {$limit: 20}, {$exit: { $cond: [ { $in: ['$genre',['science fiction', 'fantasy']}, true, false ] }}, {$sort: { created: -1 }} // sort is skipped ]);
It would also be nice for debugging longer pipelines:
db.tapping.aggregate([ {$match:{ _id: ObjectId('5bede977e8dd7e5d5df79dab') }}, {$exit: true }, // rest of pipeline would be skipped ... ]);
Thanks for your consideration.
- is duplicated by
-
SERVER-56832 Provide aggregation stage to abort pipeline halfway through
- Closed
- related to
-
SERVER-51889 Introduce new stage to peek / debug a pipeline stage's output
- Closed