Skip to content

query.withinKilometers() not working at all #5033

Closed
@Zerokk

Description

@Zerokk

Issue Description

If I perform a geoquery to my server, it does not return anything. If I remove it, and perform a regular query, it works as expected. This leads me to think that something's missing either at the Parse docs, or something is failing at the server/SDK.

Steps to reproduce

I've got a collection for my app in which I have a table "Places", for which there is a column called "location", which type is GeoPoint. Got a few mockup places that are just at a few hundred meters from my place, which will be the initial geopoint to look for.

Expected Results

It should retrieve all of these mockup places.

Actual Outcome

The query returns nothing.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.00
    • Operating System: Debian Linux (back), Windows 10 (front)
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): VPS
  • Database

    • MongoDB version: 3.2.11
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): VPS

Logs/Trace

Parse server logs have nothing in them.


Here you have my code:


            let query = new Parse.Query("Place");
            const geo = new Parse.GeoPoint(geopoint.lat, geopoint.lng)
            const res = await query.withinKilometers("location", geo, 200)        // TODO FIX
                            .include("placeType")
                            .find();

If I comment the .withinKilometers part, the query works and retrieves the data I want, but if I let it there, it will fail. I already checked if the "geopoint" data I receive at the method is okay, and it is. The problem must be either in the Parse Server, or Parse SDK.

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