im trying to do a findAndModifiy in mongodb with nodejS, This is my code:
var nextBill = function (db, success, log) { var collection = db.collection(\'
Try this It worked for me in nodejs
users.findAndModify( { "_id": userid,"password":pwd}, [['_id', 'asc']], { "$set":{"password":npwd}}, {"upsert":false} ,function(err,result){ //enter code here })