[SERVER-26294] flag nodes seen more than once in $graphLookup traversal Created: 23/Sep/16 Updated: 15/Jan/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | graph | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Query Optimization
|
||||
| Participants: | |||||
| Description |
|
When traversing a graph with $graphLookup, we suppress duplicates (in cases of cycles). It would be useful to have an option to include a flag indicating a node that caused the traversal to stop due to duplication. |
| Comments |
| Comment by David Blado [ 11/Jan/24 ] |
|
Following up on this as I have the requirement for additional pipelines after $graphLookup where there are duplicates / repeated nodes in the traversal. The additional pipelines will do mathematical calculations on quantities for manufacturing purposes. The calculations can't be performed in MongoDB if repeated nodes are stripped from the $graphLookup output. This was also requested @ https://feedback.mongodb.com/forums/924280-database/suggestions/47641904-include-or-flag-nodes-seen-more-than-once-duplic |
| Comment by David Blado [ 11/Dec/23 ] |
|
+1 this would be super helpful. I'm doing this manually by iterating the graph and adding the nodes back in. In my case, the nodes show up at different levels, so I have to compute the depth as well. |
| Comment by Scott Crunkleton [ 04/Dec/19 ] |
|
Not traversing already-visited nodes would allow for full graph traversal. This would be super helpful. |