diff --git a/cfs-autoform-hooks.js b/cfs-autoform-hooks.js index ac3c5d8..b95ac53 100644 --- a/cfs-autoform-hooks.js +++ b/cfs-autoform-hooks.js @@ -225,7 +225,7 @@ Hooks = { // or push it into the array of IDs if it's a multiple files field. else { if (arrayFields[key]) { - CfsAutoForm.Util.deepFind(doc.$set,key).push(fileObj._id); + CfsAutoForm.Util.deepFind(doc.$set,key)[key].push(fileObj._id); } else { //doc[key] = fileObj._id; CfsAutoForm.Util.deepSet(doc.$set,key,fileObj._id);