title: Updating MongoDB object field
body: <p>I have searched and tried many answers but I can't seem to get this working.  I have a user in MongoDB (db.users...) and I'm trying to update a field titled 'role' in one particular document.  If I perform a :</p>
  
  <pre><code>db.users.find();
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>{ "_id" : "fDx2g34G8vxsDu3vf", "createdAt" : ISODate("2014-06-03T16:31:47.382Z"), 
    "emails" : [  {  "address" : "andrewmlarking@gmail.com",  "verified" : false } ], 
    "profile" : { "name" : "Admin", "role" : "user", "division" : "0", "enrolled" : "false" }, 
    "services" : { "password" : { "srp" : { "identity" "dEad06c_5mjzsprUzgRyh6tB66OiaybdLzbnxFzO1xh",
    "salt" : "zqWsh etc etc
  </code></pre>
  
  <p>Which is fine, if I then perform a:</p>
  
  <pre><code>db.users.update({_id:"2xnoy3jqcHCaFp7Br"}, { role:"admin"});
  </code></pre>
  
  <p>I get a:</p>
  
  <blockquote>
    <p>assert failed : need an object Error: Printing Stack Trace
        at printStackTrace (src/mongo/shell/utils.js:37:15)
        at doassert (src/mongo/shell/assert.js:6:5)
        at assert (src/mongo/shell/assert.js:14:5)
        at DBCollection.update (src/mongo/shell/collection.js:220:5)
        at (shell):1:10</p>
  </blockquote>
  
  <p>Any ideas?</p>
  
  <p>Thanks.</p>