parse-community / parse-community/parse-server
Explicitly setting a property of a record to "undefined" and saving it to the database stores null instead of undefined
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
Issue Description
Recently upgraded from Parse 4.10 to Parse 6.5 and noticed the following change in behavior which i assume is a bug.
When storing a record in the database that has a property explicitly set to "undefined", a null value is stored.
I.e. the behavior is different than if you do not set a property on the object as save it.
Again, in Parse 4.10, storing a property explicitly set to undefined, did not touch the property (i.e. left it to whatever it was before, for example undefined).
Steps to reproduce
Use the JS SDK.
Create an empty record in the parse dashboard.
explicitly set a property to "undefined" of a record using the JS sdk.
store the record.
look at the database in the dashboard and see that the value is Null instead of undefined
Actual Outcome
Null stored in the property of the db
Expected Outcome
The property not to be updated
Environment
Server
- Parse Server version:
6.5 - Operating system:
Mac OSX Sonoma 14.4/Node - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
6.0.15 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript - SDK version:
4.1
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
Reproduce the behavior with Parse Server 6.5, the JavaScript SDK, and MongoDB by explicitly setting a record property to undefined and saving it. Compare this with leaving the property unset, then trace the server's save handling to identify why undefined becomes null; done means the property remains unchanged and regression coverage verifies both cases.
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
- 42/100