我对一些本地数据进行了 mongoexport,现在我想将其 mongoimport 到生产中。我正在尝试以下命令:
mongoimport -h production-db-b2.meteor.io --port 27017 --username client --password password_that_expires_fast --collection collection_name --db prod_meteor_com --file ./mongo_import.json
这似乎与此处发布的解决方案非常相似:how to mongoimport data to deployed meteor app?
但是,它无法处理错误无法连接到[生产-db-b2.meteor.io:27017]无法连接到服务器生产-db-b2.meteor.io:27017
我该如何解决这个问题?
(注意:我还尝试将端口和主机连接到 -h production-db-b2.meteor.io:27017
但无济于事)
最佳答案
这就是过去对我有用的方法。我不太确定为什么它有效,而您的解决方案却无效,但我认为这与未以某种方式指定集合或文件有关。
mongoimport -u client -h production-db-b2.meteor.io:27017 -d myapp_meteor_com -p passwordthatexpiresreallyfast /pathtofile
关于mongodb - 我如何使用 Meteor 进行 mongoimport?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19963166/