I am trying to use findAndModify
with the node.js mongodb module monk
.This is the method that I am using,this throws a 500
error in my cmd
:
notesCollection.findAndModify({_id:_id},[],{_id:_id,title:title,content:content},{'new':true,'upsert':true},function(err,doc){
if(err)
console.error(err);
else
{
console.log("Find and modify successfull");
console.dir(doc);
}
});
I obtained the method signature here.I get an error that looks like this and is uninformative:
POST /notes/edit/542bdec5712c0dc426d41342 500 86ms - 1.35kb