In MongoDB, the $not
aggregation pipeline operator evaluates a boolean and returns the opposite boolean value.
In other words, when the boolean evaluates to true
, the $not
operator returns false
. And when the boolean evaluates to false
, the $not
operator returns true
.