title: MongoDB Find an element in an array (subdocument)
body: <p>I am trying to update an array field in an subdocument array in my collection. My collection looks like this:</p>
  
  <pre><code>{
   _id:"1",
   employees:[{ eid:"2",
                ename:"test",
                is_user:true
               },
               { eid:"3",
                ename:"test2",
                is_user:true
               }
             ]
  }
  </code></pre>
  
  <p>I am trying to update the is_user status and am trying it the following way:</p>
  
  <pre><code>db.users.update({_id:"1","employees.eid":"2"},{$set:"employees.$.is_user":true},true);
  </code></pre>
  
  <p>I also tried :</p>
  
  <pre><code>db.users.update({_id:"1","employees.$.eid":"2"},{$set:"employees.$.is_user":true},true);
  </code></pre>
  
  <p>But when I run a find, for the query:</p>
  
  <pre><code>db.users.find({_id:"1","employees.eid":"2"});
  </code></pre>
  
  <p>it still gives me nothing. Can anybody help me on this ?
  Thank you..</p>