I have a MongoDB object like:
{
"courseName": "ML",
"user": ObjectId("6087dc4c2ba7a828363c9fca"),
"questions": [
{
"topics": [
"a","b"
],
},
{
"topics": [
"a","b","d"
],
}
]
}
I want to find the questions with courseName and user into questions, I want to remove the topic(s) that matches with the input topic.
How can I do this?
If my input is ["a"] then the update output should look like:
{
"courseName": "ML",
"user": ObjectId("6087dc4c2ba7a828363c9fca"),
"questions": [
{
"topics": [
"b"
],
},
{
"topics": [
"b","d"
],
}
]
}