Skip to content

Conversation

jyemin
Copy link
Collaborator

@jyemin jyemin commented Dec 19, 2019

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.

Jira: https://jira.mongodb.org/browse/JAVA-3518

Evergreen: https://evergreen.mongodb.com/version/5dfaced8e3c3317439577e34

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
@jyemin jyemin requested a review from rozza December 19, 2019 01:17
@jyemin jyemin self-assigned this Dec 19, 2019
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of questions and minor nits

@jyemin jyemin requested a review from rozza December 19, 2019 16:54
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants