I have a json array structured like this:
{
"properties": [{
"name": "ok",
"value": 1
},
{
"name": "ok_aswell",
"value": 1
},
{
"name": "ok_aswell",
"value": 2
},
{
"name": "get_rid",
"value": 2
}
]
}
I want my query to return everything except the "get_rid" record:
{
"properties": [{
"name": "ok",
"value": 1
},
{
"name": "ok_aswell",
"value": 1
},
{
"name": "ok_aswell",
"value": 2
}
]
}
I tried the suggestions from here: Conditionally include a field (_id or other) in mongodb project aggregation? , however they didn't seem to work.