Configure --jsonFormat=canonical flag in export policy.
JSON does not support all data types that are available in BSON. This means that when using JSON there will be a so called "loss of fidelity" of the information.
However, using the --jsonFormat=canonical flag in a mongoexport command will preserve all available BSON data types, so the "loss of fidelity" issue can be completely avoided.
Now we plan to export our cloud backups to an AWS S3 bucket. To do this, we would like to set up an export policy to automatically export the snapshots. We could already do this via the API. However, the data is output in relaxed mode. However, because of the "loss of fidelity" issue, we need canonical mode.
MongoDB Support has already told us that there is currently no way to specify in the export policy that --jsonFormat=canonical should be used.
However, we absolutely need this format flag and in the future we will certainly not be the only ones with this request.
-
Hello Katja. Thank you for reaching out on this. We are already using lossless encoding for snapshot export as internally we always configure the canonical flag to be true so therefore we do not expose it in public API.