public static Bson geoWithinBox ( final String fieldName , final double lowerLeftX , final double lowerLeftY , final double upperRightX , final double upperRightY ) { BsonDocument box = new BsonDocument ( "$box" , new BsonArray ( asList ( new BsonArray ( asList ( new BsonDouble ( lowerLeftX ) , new BsonDouble ( lowerLeftY ) ) ) , new BsonArray ( asList ( new BsonDouble ( upperRightX ) , new BsonDouble ( upperRightY ) ) ) ) ) ) ; return new OperatorFilter < BsonDocument > ( "$geoWithin" , fieldName , box ) ; }
Creates a filter that matches all documents containing a field with grid coordinates data that exist entirely within the specified box .