开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜