Why would I want to store as ISODate as opposed to simple text?
What are the advantages of storing date in database as an ISODate as opposed to a simple text?
1.2k Views Asked by Strong Like Bull AtThere are 2 best solutions below

ISODate
in MongoDB is just a function that provides a friendly wrapper for the usual JavaScript Date constructor. When you say this in MongoDB:
ISODate('2011-11-05T18:33:25Z')
You're saying the same thing as:
new Date(1320518005000);
but a human can read an ISO 8601 date a lot easier than they can read the number of milliseconds since January 1 1970.
So, using ISODate
gives you a real Date object in the database that you can call methods on (such as getMonth
) while also being able to easily eye ball its value. If you used a string for the date, then you'd be parsing strings all the time when you had to work with your dates. An example would be doing a map/reduce to aggregate monthly data; you could parse the strings to extract the month but why bother with that when you can use a real date object that knows what months are?
According to this source: