I\'m generating a complicated Mongo query depending on multiple parameters. One of criterion that I want to make with Criteria helper class is:
Mongo
Criteria
Query query = new Query(Criteria.where("field1").exists(true).ne(false));
Or, if field1 is always a boolean value when present:
Query query = new Query(Criteria.where("field1").is(true));