Is there a way to ignore javascript comments when deserializing BSON objects using the MongoDB C# Driver? -
i have poco object serialized using myobject.tojson() using bsonextensionmethod included in mongodb c# driver. taking string , appending javascript comments textual description , metadata before persisting disk .js file.
the object looks this:
{ // myobject created 2014-08-18 "name" : "myobject", "description" : "super cool object" } when try deserialize object using
var myobject = mongodb.bson.serialization.bsonserializer.deserialize<myobject>(json); i error
an unhandled exception of type 'system.io.fileformatexception' occurred in mongodb.bson.dll additional information: json reader expecting name found '//'. is there way ignore javascript comments without manually removing them first? seems should default behavior.
note: when serialize object using tojson(), passing in jsonwritersettings inserts line returns, specifies indent, etc.
Comments
Post a Comment