Skip to content

Geo Data not saving the correct way even when lat/lng in correct order #5907

Closed
@REPTILEHAUS

Description

@REPTILEHAUS

Expected Results

Geo Query returns correct values

Actual Outcome

GeoPoint seems to save backwards even though lat/lang is saved in correct order

Environment Setup

  • Server

    • parse-server version 3.50
    • Operating System: OSX / Mongo Atlas DB v4
    • Hardware: Macbook pro
    • Localhost or remote server? Localhost but DB is cloud based on MongoAtlas running mongo v4
  • Database

    • MongoDB version: v4

Logs/Trace

I saved user location like so

When I try to retrieve it it comes back backwards
{"__type":"GeoPoint","latitude":14.40,"longitude":50.00}
desired result is
{"__type":"GeoPoint","latitude":50.00,"longitude":14.40}

Once saved it looks like a standard array in the DB and appears to be in the right order, but testing and outputting in the server console reveals the full type as above with lat/lng incorrect.

location: Array[
0:50.09
1:14.46
]```


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