I have a collection, and inside this collection I have an array of objects called Degrees.
This array contains objects with keys {Uni:'',Level:'',Degree:''}, I want to be able to add to a parameter object the ability to find any document with a degree where level = 'BS', for example, regardless of what the other fields in the object contain.
I have tried so far:
{
$elemMatch: {
$eq: {
Uni: {
$exists: true,
},
Level: "BS",
Degree: {
$exists: true
}
}
}
}
But it has not worked, any suggestions?