title: Limit fields of a find operator using java monogodb
body: <p>I have a collection of users with an embedded document array containing the id of his friends.</p>
  
  <pre><code>{
    "_id": "11",
    "name": "jhon",
    "userFriends": [
      {
        "user_id": "22"
      },
      {
        "user_id": "12"
      }
    ]
  }
  </code></pre>
  
  <p>I want to get all friends ID where <code>_id</code> = "11";</p>
  
  <p>I am trying to use this using java code</p>
  
  <pre><code>BasicDBObject fields = new BasicDBObject().append("userFriends.user_id", 1); 
  BasicDBObject query = new BasicDBObject().append("_id", "1"); 
  DBCursor results = coll.find(query, fields);
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <blockquote>
    <p>method find(Bson, Class) in the type MongoCollection is not applicable for the arguments (BasicDBObject, BasicDBObject):</p>
  </blockquote>