I have a collection “team_member” like this
{
"_id" : ObjectId("5c0e0d63421aa95f61da6f6a"),
"teams" : [
{
"allowedToAddComment" : true,
"teamId" : ObjectId("5c0a5d5b421aa91ac4fe5095"),
},
{
"allowedToAddComment" : true,
"teamId" : ObjectId("5c0e0d53421aa95f6185e967"),
}
],
"userId" : ObjectId("5c0e0d52421aa95f61b0a931")
}
{
"_id" : ObjectId("5c0e0d63421aa95f61da5d5a"),
"teams" : [
{
"allowedToAddComment" : true,
"teamId" : ObjectId("5c0a5d5b421aa91ac4fe5095"),
},
{
"allowedToAddComment" : true,
"teamId" : ObjectId("5c0e0d63421aa95f61da5d5b"),
}
],
"userId" : ObjectId("5c0e0d63421aa95f61da5d59")
}
Now I need to update “allowedToAddComment
” : false
for “teams.teamId
”: ObjectId("5c0a5d5b421aa91ac4fe5095")
. for all the document. How can i achieve that??