title: How to write a mongoose query to filter subdocuments
body: <p>I have a Mongoose schema called "Users" which has a "Roles" subdocument as one of its variables like so:</p>
  
  <pre><code>var UserSchema = new mongoose.Schema({
      email: { type: String, required: true, unique: true },
      password: { type: String, required: true },
      roles: [ { type: Number, ref: 'Role' } ]
  });
  
  var RoleSchema = new mongoose.Schema({
      _id: Number,
      name: { type: String, required: true, unique: true },
      description: { type: String, required: true }
  });
  </code></pre>
  
  <p>I want to create a Mongoose query that will find all users with roles.names of "admin" or "owner". I've tried using this query, which I thought would work, but I don't get any users when I use the <code>where...in</code> part.</p>
  
  <pre><code>var roles = ["owner", "admin"];
  User.find()
      .populate('roles')
      .where('roles.name').in(roles)
      .sort({'_id': 1})
      .exec(function (err, users) {
          res.send(users);
      });
  </code></pre>
  
  <p>Can someone tell me where my logic is wrong?</p>