[JAVA-3518] Change default UUID representation to Unspecified Created: 02/Dec/19  Updated: 28/Oct/23  Resolved: 19/Dec/19

Status: Closed
Project: Java Driver
Component/s: Codecs, Configuration
Affects Version/s: None
Fix Version/s: 4.0.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-3516 Support Handling of Native UUID Types... Closed
is related to JAVA-3378 UUIDCodec default UuidRepresentation ... Closed
Epic Link: Support standard UUID representation
Case:
Backwards Compatibility: Major Change

 Description   

The 3.12 release introduces the UuidRepresentation setting for MongoClient but leaves the default as JAVA_LEGACY.  In 4.0, we will change the default to UNSPECIFIED.

This is an intentional backwards-breaking change to make all UUID-supporting drivers use a consistent UUID representation.

Cross-driver specification available at https://github.com/mongodb/specifications/blob/master/source/uuid.rst



 Comments   
Comment by Githook User [ 19/Dec/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Fix GridFS smoke test

JAVA-3518
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/d7a61be0a285b8fc2b85f24ec43a09c67d37a9ee

Comment by Githook User [ 19/Dec/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Change default UUID representation from JAVA_LEGACY to UNSPECIFIED (#528)

  • Change default UUID representation from JAVA_LEGACY to UNSPECIFIED

This commit changes the default BSON representation of java.util.UUID
values from JAVA_LEGACY (BSON binary subtype 3 with the Java driver's
legacy byte order) to UNSPECIFIED.

This forces applications that encode or decode documents from MongoDB that
contain java.util.UUID values to explicitly specify the UUID representation
that they want to use. Typically, a new application would choose the
STANDARD (BSON binary subtype 4) representation, while an existing application
upgrading to the 4.0 driver would choose JAVA_LEGACY. Applications that
do not use UUID values (preferring ObjectId, for example) are not required
to specify the UUID representation.

Applications can specify the UUID representation either with the
uuidRepresentation connection string parameter or the uuidRepresentation
property on MongoClientSettings or MongoClientOptions.

JAVA-3518
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/72b5ceba145e2ee9320b863e2e408d93b4f19e6c

Generated at Thu Feb 08 08:59:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.