Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1221

GeoWithinBox doesn't contain enough parameters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: API
    • Labels:

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

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            Keraxel Kamil Cie?lak [X]
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: