title: Aggregation $graphLookup retrieving results in different order every-time the query is executed?
body: <p>I have the following dataset (categories):</p>
  
  <pre><code>[{
    "_id": 1,
    "name": "Root",
    "parent": null
  },
   {
     "_id": 2,
     "name": "Sub - Level 1",
     "parent": 1
   }, {
     "_id": 3,
     "name": "Sub - Level 2",
     "parent": 2
   }, {
     "_id": 4,
     "name": "Sub - Level 3",
     "parent": 3
   }
  ]
  </code></pre>
  
  <p>and I am running the following pipeline on this dataset to fetch the tree recursively:</p>
  
  <pre><code>[{
    '$match': {
      '_id': 1
    }
  }, {
    '$graphLookup': {
      'from': 'categories', 
      'startWith': '$_id', 
      'connectFromField': '_id', 
      'connectToField': 'parent', 
      'as': 'menu'
    }
  }, {
      '$sort': {
        'menu.parent': 1
      }
    }]
  </code></pre>
  
  <p>The aim is to fetch the tree recursively like this:</p>
  
  <pre><code>{
      "_id": 1,
      "name": "Root",
      "parent: "null",
      "menu": [
          {..sub},{..sub},{...sub}
      ]
  }
  </code></pre>
  
  <p>It does the job, but each time the query is executed the order of the elements in the <code>menu</code> array is different. EVERYTIME!</p>
  
  <pre><code>"menu" : [{... Sub - Level 2},{... Sub - Level 3}, {... Sub - Level 1}]
  "menu" : [{... Sub - Level 1},{... Sub - Level 3}, {... Sub - Level 2}]
  "menu" : [{... Sub - Level 3},{... Sub - Level 1}, {... Sub - Level 2}]
  </code></pre>
  
  <p>Is this the normal behaviour of <code>$graphLookup</code> or am I missing out on something? How am I supposed to sort the <code>menu</code> array?</p>