title: Node.js mongodb update over ObjectID
body: <p>I want to update my Document but it's not working 100% .</p>
  
  <pre><code>// Initialize connection once
  MongoClient.connect("mongodb://localhost:27017/testDB", function(err, database) { //"mongodb://localhost:27017/test"
    if(err) throw err;
  
   db = database;
  
  });
  </code></pre>
  
  <p>My collection row looks like:</p>
  
  <blockquote>
    <p>{ "_id" : ObjectId("53f9379ce9575bbe9ec29581"), "name:paco",
    "status:student" }</p>
  </blockquote>
  
  <p>Now if I want to update the row over the Document as follows:</p>
  
  <pre><code>db.collection('user', function(err,  collection){
                  collection.update({'_id':ObjectID(req.session.loggedIn)}, {image : filename}, {w:1}, function(err, result){
                      console.log(result);
  </code></pre>
  
  <p>I am getting just:</p>
  
  <blockquote>
    <p>{ "_id" : ObjectId("53f9379ce9575bbe9ec29581"), "image:filename" }</p>
  </blockquote>
  
  <p>How can I make an update to get my data like this??:</p>
  
  <blockquote>
    <p>{ "_id" : ObjectId("53f9379ce9575bbe9ec29581"), "name:paco",
    "status:student" , "image:filename"}</p>
  </blockquote>