mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
incr wil create key if it doesnt exist
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user