Lets say I have docs with 3 props, FieldA, B, C.
I would like to do a match of all docs that don´t have the 3 props null.
I am trying $all, $nor, $not, $ne, etc… but none are working.
Ex.
[
{ "FieldA": 1, "FieldB": 1, "FieldC": 1,}, //1
{ "FieldA": 1, "FieldB": null, "FieldC": null,}, //2
{ "FieldA": null, "FieldB": 1, "FieldC": null,}, //3
{ "FieldA": null, "FieldB": null, "FieldC": 1,}, //4
{ "FieldA": null, "FieldB": null, "FieldC": null,}, //5
]
In my aggregation, I need to match all from 1st to 4th, but not 5th.
Get only the 5th is easy, but I need the negative of that.
cheers
2
Answers
You can do it like this:
Working example
The
not
operator takes only one argument expression. LinkYou can try instead using an
and
/or
operator