title: Mongoose aggregate match nested document
body: <p>I have the following schemas:</p>
  
  <pre><code>var PostSchema = mongoose.Schema({
      idol: { type: Schema.Types.ObjectId, ref: 'User' },
      views: [ String ],
      likes: [ String ],
      ...
  });
  
  
  var UserSchema = mongoose.Schema({
      name: String,
      email: String,
      ...
  });
  </code></pre>
  
  <p>and I have this following aggregate query:</p>
  
  <pre><code>Post.aggregate([
      { $match : { '$idol.name' : new RegExp(query, 'gi') } },
      { $skip : page * 20 },
      { $limit : 20 }
  ], function(err, posts) {}
  </code></pre>
  
  <p>This code is returning the following error:</p>
  
  <pre><code>[MongoError: exception: bad query: BadValue unknown top level operator: $idol.name]
  </code></pre>
  
  <p>Is there a way to match something from a nested document?</p>
  
  <p>Thanks.</p>