When it comes to files containing JSON data, the official file extension is .json
. However, I've noticed that when using MongoDB for some time, this extension is actually used for two different types of JSON formats:
- The first type is a file consisting of a single JSON document with optional pretty printing and line breaks.
- The second type is a file containing multiple lines of minified JSON documents. Each line represents valid JSON, but the entire file as a whole is not considered valid JSON.
For instance, the mongoexport manual often uses output.json
in its examples to generate files with multiple lines of JSON. However, parsers expecting the first format may encounter issues with this file.
Are there any widely accepted alternate file extensions to distinguish between these two scenarios?