[DOCS-6886] Extended JSON docs do not match BSON spec Created: 30/Dec/15  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 SERVER-5424 Shell doesn't re-save retrieved integ... Backlog
related to MONGOSH-1032 NumberInt object wrapper is not displ... Closed
related to SERVER-11957 Support NumberInt in extended JSON Closed
Participants:
Days since reply: 1 year, 14 weeks, 1 day ago
Epic Link: DOCSP-1769

 Description   

The "Extended JSON" spec is: https://docs.mongodb.org/manual/reference/mongodb-extended-json/

The BSON spec is: http://bsonspec.org/spec.html

There are differences between the two (which are deficiencies in the Extended JSON spec, not the BSON spec). Specifically, the following BSON types are not documented at all:

  1. 0x10 — 32 bit integer, aka NumberInt
  2. 0x0D — Javascript code (source says deprecated, but spec says not)
  3. 0x0F — Javascript code w/ scope

There are other slight differences, which are less important:

  1. The HexData(subtype,hexstr), UUID(hexstr) and MD5(hexstr) variants for shell mode data_binary aren't mentioned (see the output of help misc in the shell).
  2. The following entries do not mention that their corresponding BSON types are deprecated:
    1. data_ref
    2. data_undefined
  3. It is not clear that the data_ref entry corresponds to the "DBPointer" BSON type (0x0C), and that there are alternate shell mode representations for it (specifically, DBPointer("<name>", <objectid>), and as of 3.0 DBRef("<name>", "<ref>", "<db>")).

It might also be a good idea to mention somewhere on the page that the BSON types not specifically referenced on the page are part of JSON, and so have the same representation in shell mode and strict mode (which is the normal JSON representation). This is obvious for things like numbers and strings, but perhaps less so for null (type 0x0A).



 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:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.