[SERVER-42270] $graphLookup should have a way to stop evaluation when certain criteria is met Created: 18/Jul/19  Updated: 29/Jul/19  Resolved: 29/Jul/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Arun Banala Assignee: Asya Kamsky
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-26916 $graphLookup should have option to st... Backlog
Participants:

 Description   

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.



 Comments   
Comment by Asya Kamsky [ 29/Jul/19 ]

This looks like a duplicate of SERVER-26916 closing in favor of the other ticket.

Generated at Thu Feb 08 05:00:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.