title: Mongo Find one set of field in nested object
body: <p>i have a follwing structure in mongo db</p>
  
  <pre><code>{
      "_id" : ObjectId("58e8d3323fe482ef368b4567"),
      "productId" : "poe10001134",
      "batchdetails" : [ 
          {
              "batchidId" : "BD0166",
              "batchno" : "BbfN-1444-SBRPX"
           },
          {
              "batchidId" : "BD0167",
              "batchno" : "Bff-8444-kfkff"
           },
           {
              "batchidId" : "BD01447",
              "batchno" : "Bff-8415-kfkff"
           }
  ]
  }
  </code></pre>
  
  <p>i want to achieve following result</p>
  
  <p>"productId" : "poe10001134"</p>
  
  <p>"batchno" : "Bff-8415-kfkff"</p>
  
  <p>when i execute following query </p>
  
  <pre><code>db.getCollection('table').findOne( {"batchdetails.batchidId" : "BD01447"},{productId:1,"batchidId.batchno":1})
  </code></pre>
  
  <p>it returns all the batch no</p>
  
  <p>"productId" : "poe10001134"</p>
  
  <p>"batchno" : "BbfN-1444-SBRPX"</p>
  
  <p>"batchno" : "Bff-8444-kfkff"</p>
  
  <p>"batchno" : "Bff-8415-kfkff"</p>