incr wil create key if it doesnt exist

v1.18.x
Baris Soner Usakli 11 years ago
parent cb6c42ea44
commit bf3822e8a5

@ -184,7 +184,7 @@
module.incrObjectFieldBy = function(key, field, value, callback) {
var data = {};
data[field] = value;
db.collection('objects').update({_key:key}, {$inc : data}, function(err, result) {
db.collection('objects').update({_key:key}, {$inc : data}, {upsert:true}, function(err, result) {
module.getObjectField(key, field, function(err, value) {
callback(err, value);
});

Loading…
Cancel
Save