fix findAndModify

temp fix for connect-mongo
create admin after categories
This commit is contained in:
Barış Soner Uşaklı
2015-03-03 16:16:32 -05:00
parent e421a2c7cd
commit 6bd3c54a03
5 changed files with 8 additions and 6 deletions

View File

@@ -118,7 +118,7 @@ module.exports = function(db, module) {
return callback();
}
db.collection('objects').findAndModify({_key: key}, {}, {$inc: {value: 1}}, {new: true, upsert: true}, function(err, result) {
callback(err, result ? result.value : null);
callback(err, result && result.value ? result.value.value : null);
});
};