parse-community / parse-community/parse-server
Mongo explain results incorrectly returning an object instead of an array of objects
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
Mongo explain results incorrectly returning an object instead of an array of objects. This causes an issue for SDKs that use strongly typed languages as results (plural) should always be an array.
This will break any SDK that isn't strongly typed. In the case of the JS SDK, it will break current testcases instead (PR for JS SDK here. In addition, this brings up another issue in the JS SDK which doesn't support explain for first queries.
Originally discussed on community.parseplatform.org
Steps to reproduce
Run any explain query.
Actual Outcome
A single explain object.
Expected Outcome
An array of explain objects that have only 1 object.
Failing Test Case / Pull Request
- 🤩 I submitted a PR with a fix and a test case.
- 🧐 I submitted a PR with a failing test case.
Environment
Server
- Parse Server version:
4.5.0and latestmaster - Operating system:
docker linux - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
self hosted
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
4.4 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
self hosted
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
Swift SDK - SDK version:
1.8.3
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing any MongoDB explain query in Parse Server and trace the response handling; the issue names no source file or test. Use the submitted failing-test and fix PR as context, and consider the issue complete when the response exposes results as an array containing the single explain object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100