I need some clarity has to why/how to update Minimongo subdocument array object value.
Tried doing the following but I received the error below. What is the best approach for this?
data: {
_id: "DrzG9Du5rZes2bfQg"
creationDate: Tue Nov 17 2015 22:04:53 GMT-0700 (US Mountain Standard Time)
listItems: [{
creationDate: Tue Nov 17 2015 22:05:11 GMT-0700 (US Mountain Standard Time)
isDone: false
isle: "1"
itemName: "Lobster"
num: 0
quantity: "1"
}]
}
'click #isDone': function (e, tmpl) {
let setData = {};
const index = tmpl.$('input').index();
const itemTarget = 'tmpl.data.listItems.' + index + '.isDone';
setData[itemTarget] = tmpl.$('#isDone').checked;
Stores.update({
_id: tmpl.data._id
}, {
$set : setData
});
}
update failed: MongoError: ‘$set’ is empty. You must specify a field like so: {$mod: {: …}}
Thanks!