-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Minor Change
The official format for a Binary object is {{
{"$binary": "<bindata>", "$type": "<t>"}}} (the type is a two-char hex string) [ref], but json_util uses {{
{"$binary": "<bindata>", "$type": <t>}}} (the type is an integer) instead.
I noticed this bug when trying to read the output of mongoexport from Python.
I've attached a patch to fix this bug. The patch also updates the doctests in the json_util module.
This change will break any code that has stored the broken JSON anywhere and then reads it back after updating.