-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
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