parse-community / parse-community/parse-server

Using limit() in count queries is ignored

Open
#8,811 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

Using .limit(X) in a count() query is ignored.

Steps to reproduce

Run a query with .limit(X) on a collection.

Actual Outcome

The count result is the number of rows matching the query, which can be greater than the specified limit.

Expected Outcome

The count is the smallest of the number of rows and the X in .limit(X).

Environment

Server

  • Parse Server version: 6.5.0-beta.1
  • Operating system: Ubuntu 22
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 5.3.2
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local
Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a Parse Server count query using .limit(X) against MongoDB, then trace how the count query handles the limit. Compare the result with the expected minimum of the matching-row count and X. Done means the count respects the limit without changing ordinary count behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.