title: Trying to use $lookup to retrieve data from two collections of same database
body: <p>I am trying to retrieve data from two collections posts and users with userId and ObjectId(_id) respectively as joining condition using $lookup. But it just returns me data from collection posts along with an empty array. Here is my query.</p>
  
  <pre><code>db.posts.aggregate([{
      $lookup: {
          from: 'users',
          localField: 'userId',
          foreignField: '_id',
          as: 'user_data'
      }
  }]).pretty();
  </code></pre>