title: Query returning null - Using Java Driver for Mongo
body: <p>I am trying to update a collection by querying the id of the collection, but for some reason I am not able to update the collection at all. What am I doing wrong?</p>
  
  <pre><code>        DBCollection collection  = db.getCollection("sv_office_src");
  
          for(OutputSet o : outputData) {
              BasicDBObject searchOfficeQuery = new BasicDBObject();
              searchOfficeQuery.append("_id", o.getId());
              //collection.findOne(searchOfficeQuery);
  
              System.out.println(searchOfficeQuery);
  
              BasicDBObject newUpdateDocument = new BasicDBObject();
              newUpdateDocument.append("target_key", o.getTarget_key());
              newUpdateDocument.append("target_office_id", o.getTarget_office_id());
              newUpdateDocument.append("target_firm_id", o.getTarget_firm_id());
              newUpdateDocument.append("score", o.getScore());
  
              BasicDBObject updatedDocument = new BasicDBObject();
              updatedDocument.append("$set", newUpdateDocument);
  
              collection.update(searchOfficeQuery, updatedDocument);
  
              System.out.println("Output : " + updatedDocument);              
          }               
  </code></pre>
  
  <p>and the output is as follows:</p>
  
  <pre><code>{ "_id" : "52c6f6d5250c7ef0f654c7dd"}
  </code></pre>
  
  <p>Output : </p>
  
  <pre><code>{ "$set" : { "target_key" : "440786|PO BOX 15007|||WILMINGTON|US-NC|28408-5007|US" , "target_office_id" : "503677" , "target_firm_id" : "87277" , "score" : "17"}}
  </code></pre>
  
  <p>So I am getting the right document, but in the <code>mongo</code> shell when I am doing the following, you will see that the updated columns are blank.
  I know the key <code>Firm_Name</code> for the above id.</p>
  
  <pre><code>&gt; db.sv_office_src.find ({Firm_Name: "1717 Capital Management Company"})
  { "_id" : ObjectId("52c77b8d250ca11d792200aa"), "Firm_Name" : "1717 Capital Management Company", "Firm_Id" : "6715", "Office_Id" : "200968", "Office_Address_Line_1" : "PO BOX 15626", "Office_Address_Line_2"
  : "", "Office_Address_Line_3" : "", "Office_City" : "WILMINGTON", "Office_Region_Ref_Code" : "US-DE", "Office_Postal_Code" : "19850-5626", "Office_Country_Ref_Code" : "US", "src_key" : "200968|PO BOX 15626||
  |WILMINGTON|US-DE|19850-5626|US", "target_key" : "", "target_office_id" : "", "target_firm_id" : "", "target_firm_name" : "", "score" : "" }
  </code></pre>