title: MongoDB query to retrieve a specific value from the document located in a array
body: <p>I am trying to make a request in a document with mongodb.</p>
  
  <p>In this document </p>
  
  <pre><code>{
      "_id" : ObjectId("5bd19a92da24674fdabd26b6"),
      "search" : "try",
      "name" : "try",
      "email" : "yes@gmail.com",
      "password" : "$2a$10$YIRuApqDy/L8HU7R1k2SB.aC2hqH8xFDbl3/muF7PsoN6/SGzsH4q",
      "color" : 0,
      "profil" : "",
      "banner" : "",
      "desc" : "",
      "date" : 45587899,
      "friend" : [
              {
                      "id" : ObjectId("5bcee588ae409f434d35c76c")
              }
      ],
      "groupes" : [ ]
  }
  </code></pre>
  
  <p>I'm looking to get just the id in friend, not all of the document just 1 id in friend with where i try this :</p>
  
  <pre><code>db.users.find({$and:[{"friend.id":"ObjectId(5bcee588ae409f434d35c76c)"},{"search":"try"}]})
  </code></pre>
  
  <p>It's not working i got no result.</p>
  
  <p>Thank you for helping me.</p>