mognodb 3.x 导入json格式数据的坑

    xiaoxiao2021-03-25  158

    需要将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 

    转载请注明原文地址: https://ju.6miu.com/read-4759.html

    最新回复(0)