Skip to content

Limiting the number of query results incorrectly applied due to batchSize #129

@mrfelton

Description

@mrfelton

When using the mongo connector, applying a limit to a query does not limit the results properly. Actually, the number of results returned corresponds to the batchSize that is set for Mongo (1000 in my case). Query limits work correctly up to the point where the batchSize is reached.

For example:

curl -s "http://127.0.0.1:3000/api/v1/Events?filter\[limit\]=100" | jq '. | length' # returns 100 results
curl -s "http://127.0.0.1:3000/api/v1/Events?filter\[limit\]=500" | jq '. | length' # returns 500 results
curl -s "http://127.0.0.1:3000/api/v1/Events?filter\[limit\]=1000" | jq '. | length' # returns 1000 results
curl -s "http://127.0.0.1:3000/api/v1/Events?filter\[limit\]=1200" | jq '. | length' # returns 2000 results
curl -s "http://127.0.0.1:3000/api/v1/Events?filter\[limit\]=2500" | jq '. | length' # returns 3000 results

and so on. (I'm using http://stedolan.github.io/jq/ to count the returned results easily).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions