It looks like mongoimport expects specific order of json fields while restoring data_binary fields. If "$binary" comes before "$type", everything is restored correctly. However, if "$type" comes before "$binary" (which is the case while using bson.json_util from Python libs) the object is restored as-is (i.e. "$binary" and "$type" become field names in mongodb record).
- duplicates
-
PYTHON-602 json_util.dumps should preserve field order in SON objects
- Closed