$graphLookup should have a way to stop evaluation when certain criteria is met

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • 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.

              Assignee:
              Asya Kamsky
              Reporter:
              Arun Banala
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: