title: find object array data field in mongodb
body: <p>MongoDb data display like that.</p>
  
  <pre><code>{
  "_id" : ObjectId("57b1fc8b6ad888063048e72e"),
  "createdprojectName" : "Buffer Stock",
  "createdprojectData" : [ 
          {
              "Status" : "OnAir",
              "No" : "1",
              "Site_Name" : "hjghjgjhg",
              "Site_ID" : "gjhgjhg",
              "OnAir_Target_Date" : "2016-08-01",
              "Region" : "1",
              "OnAir_Actual_Date" : "2016-08-10",
              "G2_3G_4G" : "2G"
          }, 
          {
              "Status" : "TE WIP",
              "No" : "2",
              "Site_Name" : "sadsdssd",
              "Site_ID" : "dvvs",
              "OnAir_Target_Date" : "2016-08-01",
              "Region" : "1",
              "OnAir_Actual_Date" : "",
              "G2_3G_4G" : "2G"
          }, 
          {
              "Status" : "OnAir",
              "No" : "1",
              "Site_Name" : "sadsadsdadadadsadsad",
              "OnAir_Target_Date" : "2016-07-01",
              "Site_ID" : "sadsad",
              "OnAir_Actual_Date" : "2016-07-13",
              "Region" : "1",
              "G2_3G_4G" : "3G"
          }],
  "createdprojectChechByManager" : "false"
  }
  </code></pre>
  
  <p>I want to find only <code>Status</code>=<code>OnAir</code> data filtering above data fields. After filtering above data, It should be display without <code>Status</code>=<code>TE WIP</code> data object. How I create find query using mongodb query.</p>
  
  <pre><code>            BasicDBObject findQuery = new BasicDBObject();
              BasicDBObject elemMatch = new BasicDBObject();    
              DBObject statusQuery = new BasicDBObject("Status", "OnAir");   
              DBObject fields = new BasicDBObject("$elemMatch", statusQuery);
              DBObject query = new BasicDBObject("createdprojectData",fields);
              findQuery.put("createdprojectData", 1);    
              DBCursor cursor = collection.find(query, findQuery);
  </code></pre>