parse-community / parse-community/parse-server
When a date is set to null in mongoDB, parse server returns a Date set at 1970-01-01
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 server replaces null value with a Date set at 1970-01-01 when sending back the data for a query.
Steps to reproduce
In any collection with a Date field, set the value to null (either directly in the MongoDB or through the parse sdk, e.g. object.set('date', null))
Actual Outcome
I get a Date instead of null, set to 1970-01-01. (just like new Date(null)).
Expected Outcome
I expect the value to be null.
Environment
Server
- Parse Server version:
4.10.3 - Operating system:
Docker image node:14-alpine - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
AWS
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
4.4.8 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
iOS, Android, JavaScript, cURL - SDK version: not relevant. The network panel in Chrome shows the json sent by parse server already has the issue.
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
No source file or test is named in the issue. Reproduce the query response with a MongoDB-backed Parse Server using a Date field set to null, then trace the response serialization; done means the API returns null rather than a 1970-01-01 Date and a regression test covers that case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, nodejs
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100