I have these 2 documents in my 'resources' collection -
db.resources.insertMany([
{
Name: "Mark",
Gender: "M",
State: "VA",
TeamRoles:
[
{
Team: "A",
Role: "Quality Advisor",
Active: true
},
{
Team: "B",
Role: "Systems Analyst",
Active: true
}
]
},
{
Name: "Stacy",
Gender: "F",
State: "GA",
TeamRoles:
[
{
Team: "A",
Role: "Systems Analyst",
Active: true
},
{
Team: "B",
Role: "Developer",
Active: true
}
]
}])
Here, I want to update the role from 'Systems Analyst' to 'Business Analyst' for all the matching objects in the TeamRoles array across all the documents in the resources collection. Is there a way to achieve this using the Mongo DB query language (not JavaScript)?