i need help for migrationscript for a mongodb collection.
This is a example how it looks like and I wanna update it that the Error field should be an array in the future.
{
"_id": {
"$oid": "632a11c91f786f7d86d7633a"
},
"List": [
{
"Name": "WithError",
"Error": "duplicate"
},
{
"Name": "WithOutError"
}
]
}
This is a example how it should look like:
{
"_id": {
"$oid": "632a11c91f786f7d86d7633a"
},
"List": [
{
"Name": "WithError",
"Error": ["duplicate"]
},
{
"Name": "WithOutError"
}
]
}
My plan is to use updateMany, but I need help for the filter and how to do the update.
Kind Regards and Thx for the help