删除是做什么用的?我以前没见过这样的语法,有人可以帮助我吗?代码片段非常简单,它用于 node.js , mongoose , mongodb
function _update(game, callback) {
if (!game) {
callback(new Error("Game must be provided."));
return;
}
if (!game.gameId) {
callback(new Error("Game id should be provided"));
return;
}
var updates = (game instanceof Game) ? game.toObject() : game;
delete updates._id;
updates.modifiedDate = new Date();
Game.findOneAndUpdate({"_id": game.id, "deleted" : {"$ne": true}}, updates, callback);
}