for conversion getting error “[main] Error: invalid ISO date :”
Hi Devendra,
Are you performing these commands on the mongo shell ?ISODate() is only a mongo shell wrapper/helper to the Date` object.
In mongo shell, as an example you could do something as below:
let mydate = new Date("3/20/2016 10:09:08 PM").toISOString();
db.testcollect.insertOne({'foo':ISODate(mydate)});
Resulting in:
{
"_id": ObjectId("5aa0bd58fbaeb86dc1fa5da6"),
"foo": ISODate("2016-03-20T11:09:08Z")
}
You may also find Date Examples useful.
Regards,
Wan.