使用mongoimport导入数据, 报:
2021-09-24T03:08:02.281+0000 Failed: error unmarshaling bytes on document #0: JSON decoder out of sync - data changing underfoot?
2021-09-24T03:08:02.281+0000 imported 0 documents
异常。
mongoimport命令为: mongoimport -h localhost --port 27087 -u testbook_ng -pxxxxx -d testbook_ng -c report_engine_service --authenticationDatabase admin --file /tmp/report_engine_service_001.json
解决: 在导入命令中加入 --jsonArray参数。
mongoimport -h localhost --port 27087 -u testbook_ng -pxxxxx -d testbook_ng -c report_engine_service --authenticationDatabase admin --file /tmp/report_engine_service_001.json --jsonArray