title: Mongoose find by field?
body: <p>I'm using mongoDb and mongoose with nodejs (express) and everything works fine, except for this function:</p>
  
  <pre><code>router.get('/', function(req, res, next) {
  
      promotions.find({active:"true"},function(err,promo){
          if (err)  throw err;
  
          res.render('index',
              {
                  promos: promo
              });
  
      });
  
  });
  </code></pre>
  
  <p>It brings back an empty array in promo, but I do have documents in my db.</p>
  
  <p>The problem seems to be with the field active in "{active:"true"}". When I look for documents without any filter (with "find({},...") it works fine.</p>
  
  <p>When I run db.promotions.find({active: "true"}) in mongo it works.</p>
  
  <p>This is my promotion schema:</p>
  
  <pre><code>// grab the things we need
  var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  
  // create a schema
  var promotionSchema = new Schema({
      title: String,
      subtitle: String,
      url: String,
      image: String,
      active:
          {
              type: Boolean,
              default: false
          }
  });
  
  var Promotion = mongoose.model('Promotion', promotionSchema, 'promotions');
  
  // make this available to our Node applications
  module.exports = Promotion;
  </code></pre>
  
  <p>This is what I get in mongodb:</p>
  
  <p><a href="https://i.stack.imgur.com/hwNog.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hwNog.png" alt="enter image description here"></a></p>
  
  <p>I've tried every possible formats of {active:true} ({"active":"true"}, {"active":true}, etc..) and nothing works.</p>