This commit is contained in:
Julian Lam
2014-05-11 11:45:20 -04:00
parent bab140c396
commit e64c1bfec3
8 changed files with 79 additions and 20 deletions

View File

@@ -79,6 +79,10 @@ module.exports = function(db, module) {
module.setObject(key, data, callback);
};
module.increment = function(key, callback) {
db.collection('objects').update({_key: key}, { $inc: { value: 1 } }, helpers.done(callback));
};
module.rename = function(oldKey, newKey, callback) {
db.collection('objects').update({_key: oldKey}, {$set:{_key: newKey}}, helpers.done(callback));
};