Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imposible to save null to date prop #102

Closed
xrado opened this issue Sep 17, 2018 · 3 comments
Closed

Imposible to save null to date prop #102

xrado opened this issue Sep 17, 2018 · 3 comments

Comments

@xrado
Copy link

xrado commented Sep 17, 2018

schema = {
date: Date,
...

by setting date: null you get date: "1970-01-01T00:00:00.000Z"

@Ivshti Ivshti closed this as completed Sep 17, 2018
@Ivshti
Copy link
Owner

Ivshti commented Sep 17, 2018

what do you expect? Date means the date type will be enforced, which means null should not be a possible value

@xrado
Copy link
Author

xrado commented Sep 17, 2018

I expected to behave like Mongoose, where type: Date, allows you to store null.

@xrado
Copy link
Author

xrado commented Sep 17, 2018

Is there a way to define the schema prop to accept Date or null?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants