Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-6886

Extended JSON docs do not match BSON spec

      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).

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 24 weeks, 3 days ago