animalMode.update({name: 'catName'}, {age: '6'}, {multi : true}, function(err, numberAffected, raw){ if (err) return console.log(err); console.log('The number of updated documents was %d', numberAffected); console.log('The raw response from Mongo was ', raw); });
D
animalMode.remove({age: 6}, function(err){ if (err) console.log(err); })
其它
//返回文档数
animalMode.count({age: 2}, function(err, cat){ if (err) console.log(err); console.log(cat); })
您可能感兴趣的文章: