需要将2.x的数据重新导入到3.x的mongodb 但是mongodump导出的数据不一定会兼容
于是选择导出json的方式迁移数据
mongoexport -h 127.0.0.1 -port 27018 -u root -p 123456 -d bgame -c t_roleChapter -o ./t_roleChapter.json
导入json时
-h 127.0.0.1 -port 27018 -u root -p 123456 -d bgame -c table_seq --file ./table_seq.json 会导致
--file and positional argument(s)
于是全部使用完整参数名 问题解决
mongoimport --host 127.0.0.1 --port 28019 --username bgame --password bgame --db bgame --collection t_roleChapter --file t_roleChapter.json