-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
Currently when using $graphLookup there is no easy way to make the evaluation stop as soon as certain criteria is met. For example, if I want to find the shortest path from A to B, I can't use $graphLookup efficiently, since it wouldn't stop evaluation as soon as B is found. It continues until no more matching documents are found, or until the operation reaches a recursion depth specified by the maxDepth parameter.
Maybe we we add some field like `limit : <integer>` this can be solved. For the above case user can specify `limit: 1` so that we can stop evaluation as soon as we find the first object.
- duplicates
-
SERVER-26916 $graphLookup should have option to stop recursing when certain match condition is satisfied
- Backlog