title: mongo aggregate how to choose ‘$graphLookup or $lookup’
body: <p>I don't know how to choose ‘$graphLookup or $lookup’ Other similar</p>
  
  <p>I am looking forward to mongodb officially more complete documentation</p>
  
  <p>example: </p>
  
  <pre><code>{parentId: 0, cid: 1, other: 'a'},
  {parentId: 0, cid: 2, other: 'b'},
  {parentId: 0, cid: 3, other: 'c'},
  
  {parentId: 1, cid: 11, other: 'aa'},
  {parentId: 2, cid: 12, other: 'ab'},
  {parentId: 3, cid: 13, other: 'ac'},
  </code></pre>
  
  <p>result: </p>
  
  <pre><code>{
  parentId: 0, cid: 1, other: 'a', 
    children: [
     {parentId: 1, cid: 11, other: 'aa'},
    ]
  },{
  parentId: 0, cid: 2, other: 'b',
    children: [
     {parentId: 2, cid: 12, other: 'ab'},
    ]
  },{
  parentId: 0, cid: 3, other: 'c',
    children: [
     {parentId: 3, cid: 13, other: 'ac'},
    ]
  }
  },
  
  </code></pre>
  
  <p>how do?</p>