Following code gives me exception in node js saying: "need remove or update"
var args = {
query: { _id: _id },
update: { $set: data},
new: true,
remove:false
};
db.collection(COLLECTION.INVENTORY_LOCATION).findAndModify(args,
function (err, results) {
if (err) {
return callback(err);
} else {
console.log(results);
callback(null, results);
}
});
Not able to figure out the issue as I have specified the update operation.