How can I save new Date() in MongoDB?
You could try using new ISODate("2017-03-17 11:59")
. I know it is a little cumbersome, but this is the only date value that is guaranteed to work across all versions of Robomongo and MongoDB.
Further reading -
- https://github.com/Studio3T/robomongo/issues/614
- https://github.com/Studio3T/robomongo/issues/477
Just save this JSON
{"name": "whatever", "your_cool_date": "2017-03-17 11:59"}
it will be saved as a ISO date in the database:
"your_cool_date" : ISODate("2017-03-17T10:59:00Z"),