Details
-
Improvement
-
Resolution: Won't Fix
-
Major - P3
-
None
-
3.0.0
-
None
-
Windows 10
Description
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.
Attachments
Issue Links
- related to
-
JAVA-3518 Change default UUID representation to Unspecified
-
- Closed
-