NodeJS + MongoDB. Error message when performing 'update' or 'delete'
I am trying to update collection (mongodb-1.4.4) on Mandriva box running NodeJS:
mycollection.update( {name: 'myname'}, {$set: { mydata: 'new data' }},
function (err) {
if(err){
res.end("Error updating mycollection. " + err);
return;
}
res.end('Success');
});
Database is updated but the callback's been called with error:
Error开发者_运维问答 updating mycollection. : Server Error:
{ errmsg: 'no such cmd', 'bad cmd': { getLastError: 1 }, ok: 0 }
What could be the reason?
精彩评论