I have mongo document like
{
"_id" : ObjectId("59ad2dbd7549de7c69ef0132"),
"customerId" : "TELEFONICA",
"organization" : "TELEFONICA",
"description" : "",
"events" : [
{
"id" : "abandonCartEvent",
"name" : "Abandoned Cart Event",
"attributes" : [
{
"attrId" : "geoLocation",
"attrName" : "Customer Location",
"defaultValue" : "London"
},
{
"attrId" : "traits",
"attrName" : "Customer Traits",
"defaultValue" : "Sports Lover"
}
]
},
{
"id" : "resumeEvent",
"name" : "Resume Event",
"attributes" : [
{
"attrId" : "geoLocation",
"attrName" : "Customer Location",
"defaultValue" : "London"
},
{
"attrId" : "traits",
"attrName" : "Customer Traits",
"defaultValue" : "Sports Lover"
}
]
},
{
"id" : "cancelEvent",
"name" : "Cancel Event",
"attributes" : [
{
"attrId" : "geoLocation",
"attrName" : "Customer Location",
"defaultValue" : "London"
},
{
"attrId" : "traits_",
"attrName" : "Customer Traits",
"defaultValue" : "Sports Lover"
}
]
}
]
}
Here I want to update "attributes" array, i.e, I need to modify any one object of attributes array.
Can someone provide me solution for updating this nested document