[CSHARP-1221] GeoWithinBox doesn't contain enough parameters Created: 23/Mar/15  Updated: 02/Apr/16  Resolved: 24/Mar/15

Status: Closed
Project: C# Driver
Component/s: API
Affects Version/s: 2.0
Fix Version/s: 2.0

Type: Bug Priority: Major - P3
Reporter: Kamil Cie?lak [X] Assignee: Unassigned
Resolution: Done Votes: 0
Labels: rc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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 ] ] }



 Comments   
Comment by Githook User [ 24/Mar/15 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-1221: Fix incorrect method signature for $geoWithin $box
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/70e2849cc3e0216994878bd57472f8a7be3d1772

Comment by Craig Wilson [ 24/Mar/15 ]

Yep. Looks like I misread the documentation. Will get this fixed ASAP. Thanks for testing the driver and reporting the bug.

Generated at Wed Feb 07 21:39:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.