title: Node Mongo Query Nest Object/Model _id
body: <p>I have the models:</p>
  
  <pre><code>var carSchema = new mongoose.Schema({
    year: {
        type: [Number],
        required: true
    },
   brand: {
      type: String,
      required: true
   },
  model: {
      type: String,
      required: true
  }
  
  });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>var productSchema = new mongoose.Schema ({
    name: { type: String, required: true },
    // Pictures must start with "http://"
    pictures: [{ type: String, match: /^http:\/\//i }],
    price: {
      amount: {
        type: Number,
        required: true
      },
      // Only 2 supported currencies for now
      currency: {
        type: String,
        enum: ['CAD','USD'],
        required: true,
  
      }
    },
    category: Category.schema,
    cars: [Car.schema],
    internal: {
      approximatePriceCAD: Number
    }
  });
  </code></pre>
  
  <p>I'm trying to query the nested car _id, but it is not returning me any documents. Querying other car parameters such as model or brand will give me results but not _id. </p>
  
  <p>For example,</p>
  
  <pre><code>app.get('/product/vehicle/:id', function(req, res) {
      Product.find({'cars._id' : req.params.id}, function(error, docs) {
        return res.json({products: docs});
      });
  });
  </code></pre>
  
  <p>will return empty docs.</p>
  
  <pre><code>app.get('/product/vehicle/:brand', function(req, res) {
      Product.find({'cars.brand' : req.params.brand}, function(error, docs) {
        return res.json({products: docs});
      });
  });
  </code></pre>
  
  <p>will return me the proper documents. Any ideas?</p>