Deserializing JSON from mongo export - base64 error
I want to import JSON that has been exported by the standard mongoexport utility. A sample of what I want to import is:
_{"id":"b90f595e-60ed-413a-b478-88bbbca477b4","OrganizationId":{"$binary":{"base64":"JVCw3FD0P0iangsRGG3oKg==","subType":"03"}},"GroupName":"default"}
When I use LiteDB.JsonSerializer.Deserialize(json) I get:
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters
Yet the Base64 is fine when I decode it otherwise.
Is this the right way to do this?
@djarvis Our Json deserializer expects the following format for the binary subdocument:
{"OrganizationId": {"$binary": "JVCw3FD0P0iangsRGG3oKg=="}}
Ok, thanks. I'll have to massage the data coming out of mongoexport to fit. Not a huge deal.
Thanks for the suggestion! It's now part of #2833, which collects the related feature requests in one place so they can be discussed and prioritised together. Closing this as a duplicate — please follow #2833 and add your use case there.