title: I want to find fields from nested array in mongo document
body: <p>I am not able to select below fields from the document in mongodb</p>
  
  <pre><code>db.InsuranceRecords.find({$and:[{status: "BOOKED"}, {"products.status":"BOOKED"} ]})
  
  db.InsuranceRecords.aggregate(
      {$match:{$and:[{status: "BOOKED"}, {"products.status":"BOOKED"} ]}},
      {$project:{        
          "tripId":1,
          "products": {$filter: {
              input: '$products',
              as: 'i',
              cond: {$eq: ['$$i.status', "BOOKED"]}
          }}
      }} )
  </code></pre>
  
  <p>Fields to select</p>
  
  <pre><code>    "tripId":1,
      "products[].internalName":1
      "products[].benefits[].internalName":1
      "products[].benefits[].cost[].amount":1
      "products[].benefits[].cost[].currencyCode":1
  </code></pre>
  
  <p>From the products array, there will be only 1 element having <code>products.status = booked</code>. However I want to read internal name of each benefit and their amount and currencyCode.</p>