Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-2174

bson-rust - PR #519: feat(extjson): parse legacy `{"$date": <ms since epoch>}`

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • bson-2.14.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      xiangjinwu has created [PR #519: feat(extjson): parse legacy `

      {"$date": <ms since epoch>}

      `|https://github.com/mongodb/bson-rust/pull/519] in bson-rust

      Issue Text:
      According to the specification, there exists a legacy Extended JSON form of Datetime
      https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md#datetime
      > Mongoexport 2.4 and the Java driver always transform a Datetime object into an Extended JSON string of the form `

      {"$date": <ms since epoch>}

      `. This form has the problem of a potential loss of precision or range on the Datetimes that can be represented.

      Specially, this legacy form is called `JsonMode.STRICT` in the Java `JsonWriterSettings`, while the canonical form is `JsonMode.EXTENDED`. The former is still used by the Debezium connector for MongoDB.

      This PR adds the ability to parse such legacy format, without conflicting with the standard ones.

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            dbeng-pm-bot TPM Jira Automations Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None