Home > Software design >  Using Newtonsoft with MongoDB
Using Newtonsoft with MongoDB

Time:10-04

I know that Newtonsoft's Json.NET library is capable of serializing and deserializing BSON, via an additional NuGet package. Is it possible to use it as a serializer and deserializer for the MongoDB driver, instead of the default one?

I'm already using Newtonsoft library to serialize data for wire transfer in an application. I am planning to add storage to this application using MongoDB and I'd like to avoid using two different libraries for serialization.

CodePudding user response:

I think it is not possible yet. Because at this time the conversion part is done by drivers. And mongodb driver api is not exposed to modified it to use another outside code. Unless you modify original source code to accept outside library as plugin.

  • Related