Is there any way for Mongo to return some indication (flag, field, etc..) for if an input in a $in
does not match any docs
?
Please see my Mongo Playgrond
That successfully just returns all odd documents.
How can I have some indication that the evens were not found?
I’d like to do this within Mongo itself. I get I can iterate through the results in JS
and perform a diff
.
Fwiw, I this $in
will actually be the first stage of a $match
in an aggregate
. So maybe I can use something like addFields
for the unmatches.
Thanks!