title: MongoDb $lookup nested document in array fields
body: <p>I have a list of document categories ： documentCategory
  I have a document table<br />
  How do I put individual documents in Document into UI children in documentCategory</p>
  <pre class="lang-js prettyprint-override"><code>
  1、I have a list of document categories ： documentCategory
  
  {
      &quot;_id&quot; : ObjectId(&quot;61cd249f50f3abf2e172d743&quot;),
      &quot;name&quot; : &quot;Vue3&quot;,
      &quot;pid&quot; : &quot;-1&quot;,
      &quot;level&quot; : 1,
      &quot;children&quot; : [ 
          {
              &quot;name&quot; : &quot;UI&quot;,
              &quot;pid&quot; : &quot;61cd249f50f3abf2e172d743&quot;,
              &quot;level&quot; : 2,
              &quot;_id&quot; : ObjectId(&quot;61cd27d1f3b969fec5458d89&quot;)
          }
      ]
  }
  
  
  2、I have a document table  
  {
      &quot;_id&quot; : ObjectId(&quot;61cd4813db3e3db388e1d7cf&quot;),
      &quot;name&quot; : &quot;ElementUI&quot;,
      &quot;cid&quot; : &quot;61cd27d1f3b969fec5458d89&quot;,
      &quot;cname&quot; : &quot;UI&quot;,
      &quot;pid&quot; : &quot;61cd249f50f3abf2e172d743&quot;,
      &quot;pname&quot; : &quot;Vue3&quot;,
  }
  </code></pre>
  <p>Hoping to get results ：</p>
  <pre><code>
  {
      &quot;_id&quot; : ObjectId(&quot;61cd249f50f3abf2e172d743&quot;),
      &quot;name&quot; : &quot;Vue3&quot;,
      &quot;pid&quot; : &quot;-1&quot;,
      &quot;level&quot; : 1,
      &quot;children&quot; : [ 
          {
              &quot;name&quot; : &quot;UI&quot;,
              &quot;pid&quot; : &quot;61cd249f50f3abf2e172d743&quot;,
              &quot;_id&quot; : ObjectId(&quot;61cd27d1f3b969fec5458d89&quot;),  
              children:[
                  {name:'ElementUI'},{name:'**'}
              ]
          }
      ]
  }
  </code></pre>
  <p>How do I put individual documents in Document into UI children in documentCategory</p>