title: Querying documents into one specific property in MongoDB
body: <p>I wanted to query all &quot;doc&quot; properties inside the &quot;doc&quot;, like a nested. I guess you can understand further what I want to explain from the code below:</p>
  <pre><code>mongoose.connect(&quot;mongodb://127.0.0.1:27017/stationDB&quot;);
  
  const docSchema = mongoose.Schema({
    naturka: String,
    address: String,
    coefficient: String,
    wheel: String,
    weight: Number
  })
  
  const stockSchema = mongoose.Schema({
    rollingStockNumber: String,
    docs: [docSchema]
  });
  
  
  const Doc = mongoose.model('Doc', docSchema);
  const Stock = mongoose.model('Stock', stockSchema);
  
  let doc;
    for(i=0; i&lt;naturkaMinifiedArrayReady.length; i++){
      const doc = new Doc({
        naturka: naturkaMinifiedArrayReady[i],
        address: arrayOfWayPlanForm[i],
        coefficient: valueOfCarLength[i],
        wheel: numberOfWheels[i],
        weight: valueOfCarWeight[i]
      });
      docs = doc
    };
  
    const stock = new Stock({
      rollingStockNumber: rollingStock,
      docs: docs
    });
    stock.save((err) =&gt; {
      if (err) {
        res.redirect('/')
      }
    });
  </code></pre>
  <p>I have inserted 8 documents, but returning only the last document as you see:</p>
  <pre><code>{ _id: new ObjectId(&quot;62a1ac800d9d39966878ebb8&quot;), rollingStockNumber: '922698012567076507200129101700057022060000000', docs: [ { naturka: '08 94331444 0271 030 72240 00300 0012 0 0 0 0 01/00 96 04 105 0200 OXP', address: 'Toshkent', coefficient: '1.05', wheel: '4', weight: 50, _id: new ObjectId(&quot;62a1ac800d9d39966878ebb7&quot;) } ], __v: 0 } 
  </code></pre>