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

Introduce way to serialize to / deserialize from Bson with is_human_readable = false

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Unknown
    • Resolution: Fixed
    • None
    • bson-2.1.0
    • BSON
    • None

    Description

      The raw serializer and deserializer currently return false from is_human_readable, since BSON is a binary format. The Bson serializer / deserializer returns true for this method, however. This can cause identical values to serialize differently depending on whether to_vec or to_bson is used, which can be confusing. See this user's comment on a related GitHub issue for a good overview of some of the problems.

      Unfortunately, changing is_human_readable to return false would constitute a breaking change, since the output formats that users' existing code produces may change. To alleviate this issue in a non-backwards-breaking way, we should introduce some way of allowing users to serialize to / deserialize from Bson using is_human_readable = false. Some options include a new function specifically for this (e.g. to_bson_not_human_readable), a more general options-configurable to_bson, or even a bson-not-human-readable feature flag.

      Attachments

        Issue Links

          Activity

            People

              patrick.freed@mongodb.com Patrick Freed
              patrick.freed@mongodb.com Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: