I want to add a value to an array that is inside another array. My document is like:
{categories:[{categoryName:"a category", items:[{itemName:"an item", arrayOfValues:[1]}]}]}
I would like to use $addToSet to arrayValues. To do so I am doing an update with a query
table.update({"categories.items.itemName" : "anItem"}, {$addToSet: "categories.$.items.$.arrayOfValues":"10"})
but I get an error: can't append to array using string field name [$]
What am I doing wrong? Is it possible to update with nested arrays?
Thanks