I have nested object of objects. Each document in collection looks like this:
{
anything: "whatever",
something: {
// find inside of these document
a: { getThis: "wow" },
b: { getThis: "just wow" },
c: { getThis: "another wow" }
}
}
I would like to find in every getThis from each document in something.
For example I would like to find document which has getThis: "wow".
I've tried to use something like wildcard with *:
{"something.*.getThis": "wow" }
I've also tried $elemMatch but it seems it works only with array;
{ something: { $elemMatch: { getThis: "wow" } } }