Skip to content

issue with GeoPoint #4389

Closed
Closed
@eddyLazar

Description

@eddyLazar

Issue Description

I used GeoPoint parse field type, as described in documentation but did not succeed trying to use {"$within": {"$box": {[southwestGeoPoint, northeastGeoPoint]}}} for queries, it always return empty results. Then I tried to reproduce everything with mongo shell, and there is a difference between GeoPoint which is created in parse and a way which is described in mongo docs

Output when creating GeoPoint field manually according to mongo docs is

"location" : {
        "coordinates" : [ 
            55.7542146071183, 
            37.6188521534424
        ],
        "type" : "Point"
    },

Output when creating GeoPoint field with parse server as documented "__type": "GeoPoint", "latitude": 40.0, "longitude": -30.0

"location" : [ 
     37.6225, 
     55.7512
],

In first case Geo Queries works, in second does not. I'm new to mongo geo data, so maybe there is some confusion with mongo versions or engine about which i don't know.
Thanks!

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.6.5
    • Operating System: mac os
    • Hardware: macbook air
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): localhost
  • Database

    • MongoDB version: 3.2 and 3.4
    • Localhost or remote server? localhost

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions