private static Operator negateOperator(Operator operator) {
    if (operator == Operators.EQUAL) {
      return Operators.NOT_EQUAL;
    } else if (operator == Operators.NOT_EQUAL) {
      return Operators.EQUAL;
    } else if (operator == Operators.IN) {
      return Operators.NOT_IN;
    } else if (operator == Operators.NOT_IN) {
      return Operators.IN;
    } else if (operator == OptionalOperators.IS_ABSENT) {
      return OptionalOperators.IS_PRESENT;
    } else if (operator == OptionalOperators.IS_PRESENT) {
      return OptionalOperators.IS_ABSENT;
    } else if (operator == IterableOperators.IS_EMPTY) {
      return IterableOperators.NOT_EMPTY;
    } else if (operator == IterableOperators.NOT_EMPTY) {
      return IterableOperators.IS_EMPTY;
    } else {
      throw new UnsupportedOperationException("No negation for " + operator + " defined");
    }
  }
see https://docs.mongodb.com/manual/reference/operator/query/not/
NOT operator is mongo is a little specific and can't be applied on all levels
$not: { $or ... } will not work and should be transformed to $nor
criteria/mongo/src/org/immutables/criteria/mongo/FindVisitor.java