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

Add strict UUID handling to docs

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • drivers
    • None

    Description

      Hi,

      Sorry if this is in the wrong place for this.

      In https://jira.mongodb.org/browse/JAVA-3518 the default UUID representation is changed from JAVA_LEGACY to UNSPECIFIED. This is mentioned in the docs under upgrading to 4.0:

      I would argue that the current wording suggests if you simply set UuidRepresentation back to JAVA_LEGACY then you'd see no behaviour change from 3.12.x.

      However as a result of this change decoding has become stricter - 3.12.x with representation JAVA_LEGACY would still merrily decode a subtype 4 binary object as UUID:

      https://github.com/mongodb/mongo-java-driver/blob/3.12.x/driver-core/src/main/com/mongodb/DBObjectCodec.java#L369

      However in 4.0.x the representation MUST be STANDARD to decode subtype 4 as UUID:

      https://github.com/mongodb/mongo-java-driver/blob/4.0.x/driver-core/src/main/com/mongodb/DBObjectCodec.java#L368

      I understand the point of this change, I'd just like to suggest rewording the docs to be clear that this isn't a simple change of parameter default value - mixed representations of UUID in a collection will no longer be decoded leniently.

      A/C:

      As a reader, I understand the differences between using 3.12.x JAVA_LEGACY UUID representation and a 4.x JAVA_LEGACY UUID representation (for example difference in decoding a subtype 4 binary object).

      Potential Solution:

      Update the Upgrade Driver Version to further discuss the differences between 3.x and 4.x UUID representations.

      Attachments

        Activity

          People

            Unassigned Unassigned
            0d085d@gmail.com Ian Ager
            Alek Binion Alek Binion
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              17 weeks, 2 days ago