[DOCS-6992] Date format for Shell Extended JSON is incorrect Created: 18/Jan/16  Updated: 30/Oct/23  Resolved: 01/Nov/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Kevin Pulo Assignee: Kay Kim (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-2539 Document ISODate support in JSON parser Closed
Participants:
Days since reply: 1 year, 14 weeks, 1 day ago
Epic Link: DOCSP-1769

 Description   

In the Extended JSON reference for the Date type, the Shell style format is

new Date ( <date> )

where <date> is a 64 bit signed integer of millis since epoch.

However, while this format is accepted by the shell, it is not what the shell actually outputs:

> tojson(new Date(NumberLong("1453087907438")))
ISODate("2016-01-18T03:31:47.438Z")

This format is much easier for humans to work with (while still being reasonable for machines to deal with).

This has been the case since MongoDB 1.8, and so has become the defacto standard.

Thus, although ISODate is not a type (DOCS-2927), it is a valid Shell-mode Extended JSON representation of Date objects. Therefore the docs should be updated to list both of these forms as acceptable representations.



 Comments   
Comment by Education Bot [ 01/Nov/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:53:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.