Convert Newtosoft JObject directly to BsonDocument
问题 Try to convert JObject to BsonDocument using this example https://www.newtonsoft.com/json/help/html/WriteJTokenToBson.htm ( BsonWriter obsolete, so I use BsonDataWriter ) var jObject = JObject.Parse("{\"name\":\"value\"}"); using var writer = new BsonDataWriter(new MemoryStream()); jObject.WriteTo(writer); var bsonData = writer.ToBsonDocument(); Console.WriteLine(bsonData.ToJson()); output: { "CloseOutput" : true, "AutoCompleteOnClose" : true, "Formatting" : 0, "DateFormatHandling" : 0,