Seeking guidance on writing a Mongo query to remove elements from an array based on specific data.
{
"_id": ObjectId("ajdi293akjf83rhfsf398"),
"one": "oneData",
"two": [
{
"_id":ObjectId("akjf82ijikfj83jkfkj3"),
"value": 1
},
{
"_id":ObjectId("akjf82ijikfj83jkfkj3"),
"value": 2
},
{
"_id":ObjectId("akjf82ijikfj83jkfkj3"),
"value": 1
}
]
}
In this scenario, the objective is to eliminate elements in two
that contain the value 1
.
{
"_id": ObjectId("ajdi293akjf83rhfsf398"),
"one": "oneData",
"two": [
{
"_id":ObjectId("akjf82ijikfj83jkfkj3"),
"value": 2
}
]
}
If you have insights into achieving this task successfully, your feedback would be greatly appreciated. Thank you in advance.