I have a document to Mongodb update array of objects like this:
{
"myArray": [
{
"Key1": "string",
"key2": {
"entry": "aaa"
}
},
{
"Key1": "string",
"key2": {
"entry": "bbb"
}
}
]
}
And I want to modify the key2 field in each object of myArray. The expected result should be :
{
"myArray": [
{
"Key1": "string",
"key2Modified":"aaa"
},
{
"Key1": "string",
"key2Modified":"bbb"
}
]
}
Any help please ?