I'm using the following code in MongoDB v2.2 NodeJS 0.8 MongoSkin 0.5 Framework:
var db = mongo.db(admin+"@127.0.0.1:27017/database",{safe:true});
db.collection('collection').findAndModify({'code':code,'email':email},[],
{
$push:
{
'code.pub':newPub,
}
},{new:true},
function(err, result)
The new true option returns me the old value in MongoDB. Why is this happening? What is wrong?