I received a few JSON data files- however, it has the BSON datatypes included in each object; on top of that, its a really large tojson dump (millions of records).
I am trying to deserialize the data and as expected it fails.
The JSON file has things like:
"someKey" : NumberLong("1234567889"),
It also has ISODate in there...
Is there a way to handle this with Json.net? Seems like there is probably some setting to have it use a custom function rather than the built in parser for specific keys?
*Updated to include code for the stream+textreader for the very large (100GB+ file)
using (StreamReader file = File.OpenText(@"\\largedump.txt"))
using (JsonTextReader reader = new JsonTextReader(file))
{
reader.SupportMultipleContent = true;
var serializer = new JsonSerializer();
while (reader.Read())
{
if (reader.TokenType == JsonToken.StartObject)
{
Contacts c = serializer.Deserialize<Contacts>(reader);
Console.WriteLine(c.orgId);
}
}
}