How to convert BSON to JSON with human-readable date format

梦想与她 提交于 2019-12-03 04:33:45
Sanjeev Kumar Rai

bsondump converts BSON files into human-readable formats, including JSON. For example, bsondump is useful for reading the output files generated by mongodump.

Source: https://docs.mongodb.com/manual/reference/program/bsondump

Examples

bsondump --outFile collection.json collection.bson

The --pretty option outputs documents in a pretty-printed format JSON, eg:

bsondump --pretty --outFile collection.json collection.bson
Lars

To create a JSON file directly from the database, use mongoexport

mongoexport --db myDatabase --collection myCollection --jsonArray --out myJsonFile.json
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!