Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-102425

$geoNear: Misleading behavior with mismatched coordinate dimensions

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Geo
    • Query Integration
    • ALL
    • Hide

      Follow the example in this documentation page: https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/#examples

      When running the $geoNear query in the example, use a GeoJson point with 3D coordinates and you'll the see the query succeeding with the same results as if a GeoJson point with 2D coordinates was passed as input. 

      Seems to me like this should be an error but if this is by design it should be documented to prevent confusion and potential logical errors in applications. 

      Show
      Follow the example in this documentation page: https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/#examples When running the $geoNear query in the example, use a GeoJson point with 3D coordinates and you'll the see the query succeeding with the same results as if a GeoJson point with 2D coordinates was passed as input.  Seems to me like this should be an error but if this is by design it should be documented to prevent confusion and potential logical errors in applications. 
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using the $geoNear aggregation stage with mismatched coordinate dimensions (3D queries against 2D data or vice versa), the system exhibits behavior that may be misleading. Specifically, when 3D coordinates are provided in the near parameter while querying against 2D coordinate data, the server silently ignores the third coordinate value and processes the query as if a 2D coordinate was provided, without generating any warning or error. Does the $geoNear stage even support working with 3D coordinates?

            Assignee:
            will.buerger@mongodb.com Will Buerger
            Reporter:
            adelin.mbidaowona@mongodb.com Adelin Mbida Owona
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None