Details
-
Improvement
-
Resolution: Works as Designed
-
Major - P3
-
None
-
None
-
None
-
None
Description
It's really visible here in debugging: https://github.com/mongodb/mongo-csharp-driver/blob/master/src/MongoDB.Driver/Encryption/ExplicitEncryptionLibMongoCryptController.cs#L59 where wrappedKeyDocument shows that _id is in CSUUID form. But if we check the _id value itself, it will be in UUID format.
Simplified test is:
var @string = $"{{ '_id' : UUID('3fdabe71-f829-4469-9c5c-15cc4881c50c') }}"; |
var bsonDocument = BsonDocument.Parse(@string); |
var stringDocument = bsonDocument.ToString();
|
stringDocument.Should().Contain("CSUUID"); // pass |
stringDocument.Should().NotContain("3fdabe71-f829-4469-9c5c-15cc4881c50c"); // fail, pay attention that guid numbers are the same in both places |
NOTE: bytes in both cases are the same, the only difference is subType