Closed
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 versions of Parse Server and the Parse JS SDK.
Issue Description
When adding a new field with type Date
and with defaultValue
it complains that the defaultValue
should be with type date.
Steps to reproduce
const newLocalSchema = new Parse.Schema('BlaSchema')
newLocalSchema.addField('bla', 'Date', { defaultValue: new Date() })
await newLocalSchema.save()
Actual Outcome
error: Parse error: schema mismatch for BlaSchema.bla default value; expected Date but got String {"code":111,"stack":"Error: schema mismatch for BlaSchema.bla default value; expected Date but got String\n at SchemaController.addClassIfNotExists
Expected Outcome
It should work.
Environment
Server
- Parse Server version:
^4.10.2
- Operating system:
Windows
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
local
Database
- System (MongoDB or Postgres):
Mongo
- Database version:
v5.0.2
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
docker
Client
- Parse JS SDK version:
3.3.0