mongo export json code example Example: how to export mongodb database to json Click to copysudo mongoexport --db newdb -c restaurants --out newdbexport.json