title: How to update Mongo DB document with complex structure
body: <p>I have a mongoDB document with the following structure</p>
  
  <pre><code>{
    "id": 9595511812,
    "Feeds": [
      {
        "department": "mseb",
        "consumer_number": 1234567890,
        "due_date": "2016-11-11",
        "due_amount": 400,
        "balance_amount": 0,
        "unitsConsumed": 40,
        "freezeDate": "2016-11-11",
        "lastPaidDate": "2016-11-11",
        "billNumber": "9877",
        "id": "1",
        "paid": false
      },
      {
        "department": "mseb",
        "consumer_number": 1234567890,
        "due_date": "2016-11-21",
        "due_amount": 400,
        "balance_amount": 0,
        "unitsConsumed": 40,
        "freezeDate": "2016-11-21",
        "lastPaidDate": "2016-11-21",
        "billNumber": "9877",
        **"id": "2",**
        "paid": false
      }
    ]
  }
  </code></pre>
  
  <p>I want to update paid == true for Feed with id=2 (** marked field above). How can I do that in using mongo java client?</p>
  
  <p>I have tried </p>
  
  <pre><code> DB db = DBConnection.getDatabaseConnection();
          DBCollection table = db.getCollection("customer");
          BasicDBObject newDocument = new BasicDBObject();
          newDocument.append("$set", new BasicDBObject().append("Feeds.paid", "true"));
  
          BasicDBObject searchQuery = new BasicDBObject().append("id", "9595511812");
  
          table.update(searchQuery, newDocument);
  </code></pre>