For the life of me, I can’t figure out how to update a collection, because minimongo does not support positional array modification. Been trying for hours but keep going in circles. If anybody can help me, I will be forever grateful
Here is the structure of my collection.
The main collection is users, each user has a set of rules. The rules structure is the following.
rules [
{key:{value : "someValue" , date_created:"someDate1" ,date_updated :"someDate" } } ,
{key1: {value : "someValue2" , date_created:"someDate2",date_updated :"someDate" } } }
]
I need to update value, and date_updated. I have the key value (in variable form.) How can I perform this update?
My new rules structure would look like the following afterwards:
rules [
{key:{value : "**someNEWValue**" , date_created:"someDate1" ,date_updated :"**someNEWDate**" } } ,
{key1: {value : "someValue2" , date_created:"someDate2",date_updated :"someDate" } } }
]
Considering meteor doesn’t support positional array modification, I am struggling with this dearly. Any workarounds ???
Thank you.
Alex