public static Bson exists ( final String fieldName , final boolean exists ) { return new OperatorFilter < BsonBoolean > ( "$exists" , fieldName , BsonBoolean . valueOf ( exists ) ) ; }
Creates a filter that matches all documents that either contain or do not contain the given field depending on the value of the exists parameter .