-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.0
-
Component/s: BSON
-
None
-
Environment:Windows 10
According to documentation, since version 3.0 the default UUID representation is the `STANDARD` one.
Except for `UuidCodec` default constructor uses `JAVA_LEGACY` representation, making applications still store `LUUID` by default.
It is interesting to note that `ValueCodecProvider`, which is the default codec provider uses the default constructor for `UuidCodec`, making sure that `JAVA_LEGACY`/`LUUID` type is used by default.
I think the default constructor can be changed to `STANDARD` representation, as stated in documentation, and even in code:
// changed the default subtype to STANDARD since 3.0 if (encoderUuidRepresentation == UuidRepresentation.STANDARD) { writer.writeBinaryData(new BsonBinary(BsonBinarySubType.UUID_STANDARD, binaryData)); } else { writer.writeBinaryData(new BsonBinary(BsonBinarySubType.UUID_LEGACY, binaryData)); }
Environment variables could be used to restore legacy behaviour withour resorting to mess with code.
- related to
-
JAVA-3518 Change default UUID representation to Unspecified
- Closed