title: Mongoose join two different collections with different foreign key
body: <p>Users Schema:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    username: "milkeypony",
    _id: "_mongodbID",
    id: "random_30_characters_string"
    ...
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Blog Schema</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    title: "_title",
    _id: "_mongodbID",
    author: "random_30_characters_string"
    ...
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The <code>Blogs.author</code> is the same ID as with in <code>Users.id</code></p>
  
  <p>And what I'm trying to do is when I use <code>Blogs.findOne()</code> to fetch some blog post, Mongoose will also help me fetch some user data.</p>
  
  <p>And I already successfully done this with raw Mongo shell command</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>db.blogs.aggregate([
    {
      $lookup: {
        from: "users",
        localField: "author",
        foreignField: "id",
        as: "author"
      }
    }
  ])</code></pre>
  </div>
  </div>
  </p>
  
  <p>And I try the mongoose <code>populate</code> method, but it didn't work out for me</p>