RoboMongo 0.8.5 Error inserting Date

2.8k views Asked by At

Tried many formats like:

manufactureDate : new Date("2009-8-2"),

or

manufactureDate : new Date(2009,8,2),

or even

manufactureDate : new Date("Feb 8, 2009"),

Each validation try ends with:

Unable to parse JSON

Any Ideas?

1

There are 1 answers

0
Neo-coder On BEST ANSWER

In robomongo when you right clicked on collection name and click Insert documents... new pop up window open and if you insert dates as below and click on save button, then it shows error Unable to parse JSON because of robomongo not understand new Date() function in insert document view. This consider as JSON and {manufactureDate : new Date(2009,8,2)} not a valid JSON format. So Instead of inserting dates using Insert documents... use direct mongo command

enter image description here

Insert date using query for run this query press ( ctrl + enter ) :

enter image description here

This will insert date in ISODate format.