Skip to content

Geo-spatial queries return a maximum of 1000 results even with higher limits #3733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dpoetzsch opened this issue Apr 19, 2017 · 4 comments
Closed

Comments

@dpoetzsch
Copy link

Issue Description

With mongo db version 3.0.12 and 3.0.14 a geo query that also has an order specified always returns a maximum number of 1000 results.

Note: without specifying the order everything works fine.

Also, mongo db version 3.2.x fixes this issue.

Maybe this is related to #999 (comment)

Steps to reproduce

You need a table with over 1000 objects. Then:

new Parse.Query("Item")
    .withinKilometers("location", new Parse.GeoPoint(50, 10), 4000)
    .descending("createdAt")
    .limit(5000)
    .find()

Expected Results

I'd expect a maximum number of 5000 object to be returned.

Actual Outcome

A maximum number of 1000 objects is returned.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.3.8
    • Operating System: Fedora Linux
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Reproduced on Localhost, Heroku & Scalingo
  • Database

    • MongoDB version: 3.0x & 3.2.x
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Localhost, mlab, scalingo
@flovilmart
Copy link
Contributor

So that's an issue with mongodb right?

@dpoetzsch
Copy link
Author

Well it might. I was not sure, I couldn't find any information on that 1000-limit in the mongodb docs. I'm not even sure if it's a really a bug (could also by by design or because of a misconfiguration or whatever?). I hoped anyone here might have more insight what could be the reason for this.

However, if it is not a bug, I thought it would be good to at least update parse's documentation.

@flovilmart
Copy link
Contributor

We don't apply limits by default, if the query sent to the mongo driver actually has a limit higher than 1000 and from the driver we get 1000 results, this is an issue with either the driver or mongodb itself.

@flovilmart
Copy link
Contributor

Closing as related to mongodb pre 3.2. Feel free to open a PR in the docs around the geo queries if you feel it should be described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants