下载工具
去网址下载工具,并将bin文件夹内的exe放入mongodb的bin文件夹中
在mongodb的bin文件夹下,打开cmd
导出数据
mongoexport -d database -c collection -o path --type json
其中,database是数据库的名字,collection是该数据库下集合的名字,path是导出的路径,实例如下:
mongoexport -d local -c startup_log -o D:\data\data.json --type json
导入数据
mongoimport -d new_local -c startup_log --file D:\data\data.json --type json
与上边描述一致