title: How to use .where() with after a populate in mongoose
body: <p>So i have two schemas </p>
  
  <pre><code>var subcategories = new Schema({
      //the category being populated needs to be the same case ;
      categoryId: [{ type: Schema.ObjectId, ref: 'categories' }],
      name: String,
      description:  String,
      display:  Boolean,
      active: Boolean,
      sortOrder:  Number,
      createDate: Date,
      updateDate: Date,
      type:  String,
      startDate: Date,
      endDate: Date,
      authorId: String
  });
  </code></pre>
  
  <p>And</p>
  
  <pre><code>var categories = new Schema({
      name: String,
      description:  String,
      display:  Boolean,
      active: Boolean,
      sortOrder:  Number,
      createDate: Number,
      updateDate: Number,
      type:  String,
      startDate: Date,
      endDate: Date,
      authorId: String
  });
  </code></pre>
  
  <p>And I want to have a query to only return if active/display is true in both category/subcategory. What I'm having trouble with is how to properly set the filter for categoryId after a populate. Here is what I have so far</p>
  
  <pre><code>exports.generateList = function (req, res) {
      subcategories
              .find({})//grabs all subcategoris
              .where('categoryId').ne([])//filter out the ones that don't have a category
              .populate('categoryId')
              .where('active').equals(true)
              .where('display').equals(true)
              .where('categoryId.active').equals(true)
              .where('display').in('categoryId').equals(true)
              .exec(function (err, data) {
              if (err) {
                  console.log(err);
                  console.log('error returned');
                  res.send(500, { error: 'Failed insert' });
              }
  
              if (!data) {
                  res.send(403, { error: 'Authentication Failed' });
              }
  
              res.send(200, data);
              console.log('success generate List');
          });
      };
  </code></pre>
  
  <p>The only problem is even when i have a category with display = false it will still get returned.</p>