JamesNK / Newtonsoft.Json.Bson

Json.NET BSON adds support for reading and writing BSON to Json.NET
MIT License
55 stars 23 forks source link

Handle GUID with new standard way #31

Open iron9light opened 3 years ago

iron9light commented 3 years ago

It seems Mongo has introduced a new way to store GUID, and they call it Standard. see https://mongodb.github.io/mongo-csharp-driver/2.11/reference/bson/guidserialization/. I just tested and check the code.

This version (1.0.2) of Newtonsoft.Json.Bson is not compatible with the Mongo's implementation. I think this lib should support it as well.

Indeed, I tried to override the BsonDataWriter and void WriteValue(Guid value), but there are two many internal class and method I cannot access.