Skip to content

Bug when querying $relatedTo with limit and order by createdAt #6267

Closed
@cjlovescoffee

Description

@cjlovescoffee

Issue Description

When querying the objects in a relation property and setting both a limit and ordering by createdAt, not all expected objects are returned.

Removing the limit or changing the order by to another property seems to resolve the issue.

With 14 objects in the relation, the following incorrect number of objects are returned depending on the specified limit

limit numResults
1 1
2 1
3 1
4 1
5 1
6 2
7 3
8 4
9 5
10 6
11 7
12 8
13 9
14 10
15 11
16 12
17 13
18 14
19 14

I have reproduced this issue with Parse Server 3.1.3 and 3.9.0 running from the appropriate official docker images running on a linux and windows host machine running the docker image inside its linux container

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.9.0
    • Operating System: Docker Container - Alpine Linux v3.9
    • Hardware: Windows PC Host (Intel i7 8700k) - Docker For Windows
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Docker container running on Localhost
  • Database

    • MongoDB version: 3.4.4
    • Storage engine: Docker volume
    • Hardware: Same as Server above in Mongo docker container
    • Localhost or remote server? Same as server above

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions