开发者

NodeJS + MongoDB. Error message when performing 'update' or 'delete'

开发者 https://www.devze.com 2023-04-02 10:07 出处:网络
I am trying to update collection (mongodb-1.4.4) on Mandriva box running NodeJS: mycollection.update( {name: \'myname\'}, {$set:{ mydata: \'new data\' }},

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

精彩评论

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