I am creating a user management module using express.js in which I have a field 'UserLastAccess' as Date in schema UserLastAccess: { type: Date} and calling Users.save() in post method.
I am unable to send null value in the above mentioned field using postman. I have tried so far "UserLastAcces": null, [], '' using body but nothing works. That field will have a date once user will be authenticated so thats why upon creation of User it has to go null.
new Date()in your logic when you set the date-time for that field.default: undefinedwith the field if that works for you.momentvery famous for handling date in JavaScript