FieldDefinitionBuilder.GeoWithinBox methods have only 2 parameters for bounding box coordinates - x and y. It is impossible to add second corner coordinates.
Calling method creates query like this:
Bad query |
"$query" : {
|
"Location" : {
|
"$geoWithin" : {
|
"$box" : [
|
16.9,
|
52.38
|
]
|
}
|
}
|
}
|
It results in throwing an exception by mongod:
"exception" : "Can't canonicalize query: BadValue bad geo query: { $geoWithin: { $box: [ 16.9, 52.38 ] } }",
|
"exceptionCode" : 17287,
|
According to DB documentation, $box should contain two pairs of coordinates, eg.
{ $box: [ [ 0, 0 ], [ 100, 100 ] ] }
|