parse-community / parse-community/parse-server
Query on a subfield date on an array with js native date object does not work
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
PArse.Query on a subfield date on an array with js native date object does not work
Steps to reproduce
quick example:
const obj = new Parse.Object('Example')
obj.set('anArrayField', [{ date: new Date(0) }])
await obj.save()
// Elsewhere later
const query = new Parse.Query('Example')
query.lessThan('anArrayField.date', new Date())
const result = query.find()
// Result is empty but it should contain obj
Actual Outcome
Empty result, maybe related to incorrect handling of native JS date
Expected Outcome
Query a subfield date on an array with js native date object should work
Environment
Version 5.2.1
Server
- Parse Server version:
5.2.1 - Operating system:
OsX - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
4.4.2 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript - SDK version:
3.4.2
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 running the provided JavaScript reproduction against Parse Server with MongoDB, then trace query.find() handling for nested array date comparisons. The payload names no source file or regression test; done means the query returns the saved object and a regression test demonstrates the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100