1
什麼是刪除用於?我以前沒有看到這樣的語法,任何人都可以幫助我? 的代碼片段是非常容易的,它使用的node.js,貓鼬,MongoDB的node.js「刪除」的奇怪語法
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);
}
非常感謝,對不起,我的無知javascript – clevertension 2013-02-13 11:36:53
沒問題,這就是本網站的目的!你的問題是有效的,值得問,請不要道歉努力改善自己! – 2013-02-13 11:41:04