$graphLookup output should provide $$depth expression to get depth in output

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Can we get the depth of the evaluation as well along with output documents?

      db.employees.aggregate( [ { $graphLookup: { from: "employees", startWith: "$reportsTo", connectFromField: "reportsTo", connectToField: "name", as: "reportingHierarchy" } } ] )
      

      "reportingHierarchy" => should provide output like {depth: 1, documents: [{}, {}]}

      It will help us to reduce no. of queries in order to find depth of children.

              Assignee:
              Katya Kamenieva
              Reporter:
              Hitesh Baldaniya
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: