title: How to use aggregate $lookup to join documents?
body: <p>routes.js</p>
  <pre><code>routes.get('/dataWithComment', async (req, res) =&gt; {
      await Admin.aggregate
      (
          [
              {
                  $lookup:
                  {
                      from:&quot;Comme&quot;,
                      localField: &quot;fname&quot;,
                      foreignField: &quot;fname&quot;,
                      as:&quot;profile_comment&quot;
                  }
              }
              // {
              //     $unwind: &quot;$profile_comment&quot;,
              // },
          ]
      ).then((result) =&gt; {
          res.send(result);
      }).catch((error) =&gt; {
          console.log(error);
      });
  })
  </code></pre>
  <p>profile_schema.js</p>
  <pre><code>const mongoose = require('mongoose');
  
  const pSchea = mongoose.Schema({
      fname:{
          type:String,
          required: true
      },
      lname:{
          type:String,
          required: true
      }
  })
  module.exports = mongoose.model('pSchea', pSchea);
  </code></pre>
  <p>comment_schema.js</p>
  <pre><code>const mongoose = require('mongoose');
  const cSchea = mongoose.Schema({
      fname:{
          type:String,
          ref: 'pSchea',
          required:true
      },
      comments:{
          type:String
      }
  });
  module.exports = mongoose.model('cSchea', cSchea);
  </code></pre>
  <p>--------------------------OUTPUT--------------------</p>
  <pre class="lang-js prettyprint-override"><code>[
      {
          &quot;_id&quot;: &quot;620b53937c1ec7ca02df39c6&quot;,
          &quot;fname&quot;: &quot;abcd&quot;,
          &quot;lname&quot;: &quot;cdef&quot;,
          &quot;__v&quot;: 0,
          &quot;profile_comment&quot;:[]
      },
      {
          &quot;_id&quot;: &quot;620b56c8563caa82f0048d52&quot;,
          &quot;fname&quot;: &quot;asdfdsf&quot;,
          &quot;lname&quot;: &quot;fasdfdsfd&quot;,
          &quot;__v&quot;: 0,
          &quot;profile_comment&quot;:[]
      },
      {
          &quot;_id&quot;: &quot;620b56ef563caa82f0048d59&quot;,
          &quot;fname&quot;: &quot;fadsfasdf&quot;,
          &quot;lname&quot;: &quot;fasdfsdsfa&quot;,
          &quot;__v&quot;: 0,
          &quot;profile_comment&quot;:[]
      },
      {
          &quot;_id&quot;: &quot;620b585be26227fe4636b9c4&quot;,
          &quot;fname&quot;: &quot;asdddds&quot;,
          &quot;lname&quot;: &quot;fasdfdsf&quot;,
          &quot;__v&quot;: 0,
          &quot;profile_comment&quot;:[]
      },
      {
          &quot;_id&quot;: &quot;620ca22b84885b54861def87&quot;,
          &quot;fname&quot;: &quot;dafdfasdf&quot;,
          &quot;lname&quot;: &quot;asdfdsfdf&quot;,
          &quot;__v&quot;: 0,
          &quot;profile_comment&quot;:[]
      }
  ]
  </code></pre>
  <p>-----------------------------------Question---------------------------------</p>
  <p>Why it is showing <code>'[]'</code> in <code>&quot;profile_comment&quot;</code>, I have also tried uncommenting <code>&quot;$unwind&quot;</code> but then it is just showing output like <code>'[]'</code>?
  and what will be other method to do the same thing?</p>