[SERVER-26153] Order $graphLookup results by ascending depth from the source node Created: 17/Sep/16  Updated: 06/Dec/22

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

Type: New Feature Priority: Major - P3
Reporter: Konstantin Zamaraev Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 1
Labels: graph
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File graph.js    
Issue Links:
Related
Assigned Teams:
Query Execution
Participants:

 Description   

Results array of the $graphLookup should be in order from the first node to the last(from closest nodes) . Currently, it's in reversed order.

Also, Output example in implementation ticket SERVER-23725 is incorrect order.



 Comments   
Comment by Charlie Swanson [ 18/Sep/16 ]

Hi zamaraevk@gmail.com,

Thanks for the request. I've marked this to be looked at by the query team for consideration and/or scheduling.

Please note in the meantime that there are no guarantees on the order of results in the output array from $graphLookup. The visited documents are put into a set, so will be output in no particular order. If you need an order, consider specifying the 'depthField' argument, and sorting by that.

Generated at Thu Feb 08 04:11:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.