How to get updated document back from the findOneAndUpdate method?
<p>I am using MongoDB with node js , i used <code>npm install mongodb</code></p>

<p>I want to update an existing document and return the updated document , the document is updated correctly . but it returns the old document means the original document before update . i have used the <code>returnNewDocument:true</code> parameter but no use .</p>

<pre><code>            var filter = {
                '_id': object_id
            },
            update = {
                $set: { "status" : data["status"] },
                $push: {
                    "statusHistory": {
                        $each: [{ status:data["status"],statusChangedTime:data["statusChangedTime"],comment:data["comment"]}],
                        $position:0,
                    }
                },
            }
            ,options = {
                //upsert: false,
                //multi: false,
                returnNewDocument: true
            };

            col.findOneAndUpdate(filter, update, options,function(err, res) {
                if (err) {

                    console.log(err);
                }else {

                    console.log(res);
                }
            });
</code></pre>

<p>the response is </p>

<pre><code>{ lastErrorObject: { updatedExisting: true, n: 1 },
  value: 
   { 
//original document
   },     
  ok: 1 }
</code></pre>

<p>when i directly go to mongoDB through terminal and try</p>

<pre><code>db.MyCollection.find().pretty();
</code></pre>

<p>the document is updated correctly, it just returns the original instead of updated one. </p>

<p>Stuck here for 2 hours, any help is appreciated  </p>

<p>in package.json </p>

<pre><code>"mongodb": "^2.1.4",
</code></pre>