MongoDB.Driver.Builders.QueryConditionList.WithinRectangle C# (CSharp) Method

WithinRectangle() public method

Adds a $within/$box test to the query.
public WithinRectangle ( double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY ) : QueryConditionList
lowerLeftX double The x coordinate of the lower left corner.
lowerLeftY double The y coordinate of the lower left corner.
upperRightX double The x coordinate of the upper right corner.
upperRightY double The y coordinate of the upper right corner.
return QueryConditionList
        public QueryConditionList WithinRectangle(
            double lowerLeftX,
            double lowerLeftY,
            double upperRightX,
            double upperRightY
        ) {
            conditions.Add("$within", new BsonDocument("$box", new BsonArray { new BsonArray { lowerLeftX, lowerLeftY }, new BsonArray { upperRightX, upperRightY } }));
            return this;
        }
        #endregion