Json.Net using BsonWriter and MongoDb

Feb 16, 2010 at 6:03 PM


I read somewhere that you have tested the BsonWriter with MongoDb. Do you have any testcode on this that you could share? I can't get it to work? How did you handle the serialization of the custom "_id"?


Feb 16, 2010 at 8:39 PM

I compared it against the results produced by the .NET mongo db driver. All BSON unit tests are under the Src/Newtonsoft.Json.Texts/Bson directory.

Mar 1, 2010 at 6:18 AM


Of course it was me that serialized it to the pipestream in a incorrect manner.

A follow up question though.

Which is the best way to add custom support for datatypes and control how they are serialized to BSON? E.g. MongoDb's ObjectId?