title: MongoDB set multiple fields with update
body: <p>I am trying to set multiple fields with an update in MongoDB using Java</p>
  
  <pre><code>    DBObject nameQuery = new BasicDBObject();
      nameQuery.put(DBUser.LAST_SEEN_NAME_FIELD, player.getName());
      nameQuery.put(DBUser.LAST_SEEN_NAME_LOWER_FIELD, player.getName().toLowerCase());
      nameQuery.put(DBUser.UUID_FIELD, new BasicDBObject("$ne", Database.makeStorableUUID(player.getUniqueId())));
  
      DBObject updateFields = new BasicDBObject();
      updateFields.put(DBUser.LAST_SEEN_NAME_FIELD, "");
      updateFields.put(DBUser.LAST_SEEN_NAME_LOWER_FIELD, "");
  
      DBObject nameUpdate = new BasicDBObject("$set", updateFields);
  
      this.update(nameQuery, nameUpdate);
  </code></pre>
  
  <p>When this runs it doesn't throw any errors but I would assume there is something wrong with my query or update. I'm hoping someone can point me in the right direction.</p>