title: why does my aggregate ($lookup) function does not work in mongoose and node.js?
body: <p>In my <code>mongoose</code> database I have two models: <code>Users</code> and <code>Comments</code>.</p>
  
  <p>In my <code>node.js</code> code I have:</p>
  
  <pre><code>var Comment = require('./../models/commentsModel.js');
  var User = require('./../models/usersModel.js');  
  </code></pre>
  
  <p>Now I want to construct a query with <code>$lookup</code> to return results from <code>Comments</code> and corresponding <code>Users</code> (currently <code>Comments</code> contain a field <code>user_id</code>). This is what I have so far:</p>
  
  <pre><code>function executeQuery(query, callback) {
      query = Comment.find(query);
  
      Comment.aggregate([{$lookup:
      { from: "users",
          localField: "user_id",
          foreignField:"_id",
          as: "user"
      }}]);
  
      query.exec(function(err, comments){
          if(err) {
              callback(err);
              return;
          }
      return callback(null, comments);
      });
  }
  </code></pre>
  
  <p>but I do not see any data from <code>User</code> attached to the results from <code>Comment</code>. What am I missing?</p>