Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47069

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

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

      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:
            kateryna.kamenieva@mongodb.com Katya Kamenieva
            Reporter:
            hitesh.baldaniya@contentstack.com Hitesh Baldaniya
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: