How does JSON stores the date format?

Since it was said during the course that JSON can’t support date format directly, then how does it support it.

Hi @Rohit_17953,

Yes, that’s correct. JSON does not directly support the date format and it stores it as String.

However, as you have learned by now that mongo shell is a JavaScript interpreter and so in order to represent dates in JavaScript, JSON uses a specific string format ISODate to encode dates as string.

If you want to know more about it then I would recommend you to read about Data Types in the mongo Shell and MongoDB Extended JSON (v1).

Hope it helps :slight_smile:

However, if you still have any questions, do not hesitate to reach out to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hi @Shubham_Ranjan,

I am so sorry about raping this forum, but unfortunately it does not look possible to write you via some private message. I was wondering what does your “MongoDB Staff: Curriculum Support Engineer” title mean? Is there any support program from MongoDB to prove/have some working experience with MongoDB? In case of yes is there any info about it?

Thank you
Vaclav