mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-27 14:30:50 +08:00
fixed $inc not updating values of 0
This commit is contained in:
@@ -128,7 +128,6 @@ Collection.prototype.sanitize = function (body) {
|
||||
*/
|
||||
|
||||
Collection.prototype.handle = function (ctx) {
|
||||
|
||||
// set id one wasnt provided in the query
|
||||
ctx.query.id = ctx.query.id || this.parseId(ctx) || (ctx.body && ctx.body.id);
|
||||
|
||||
@@ -509,6 +508,7 @@ Collection.prototype.execCommands = function (type, obj, commands) {
|
||||
var val = commands[key][k];
|
||||
|
||||
if(k === '$inc') {
|
||||
if(!obj[key]) obj[key] = 0;
|
||||
obj[key] += val;
|
||||
}
|
||||
if(k === '$push') {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user