From 2cca8a854afee7d53b8fa68f2f30ba445e5ce7d6 Mon Sep 17 00:00:00 2001 From: Yan Shcherbakov Date: Mon, 1 Aug 2016 11:27:19 -0300 Subject: [PATCH] Updated model for groups so that when deleting a single group it doesn't wipe the groups array in the database. --- app/models/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/game.js b/app/models/game.js index 8107c77..837c3a4 100644 --- a/app/models/game.js +++ b/app/models/game.js @@ -441,7 +441,7 @@ GameSchema.statics.removeGroup = function(ids, groupId, callback) } return this.update( query, - {$pull: {groups: {"groups.group" : groupId }}}, + {$pull: {groups: {group : groupId }}}, {multi: true}, callback );