mongodb - 我如何使用 Meteor 进行 mongoimport?

标签 mongodb meteor mongoimport

我对一些本地数据进行了 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/

相关文章:

mongodb - mongoengine-referencefield 存储什么

MongoDB $sort 聚合的 Javascript 属性顺序

spring - 类 [org.jongo.bson.RelaxedLazyDBObject] 的对象必须是类 com.mongodb.BasicDBObject 的实例

javascript - 使用 Iron-router 的正则表达式路由

json - 使用 mongoimport 导入超过 1 个 json 文件

mongodb - mongoimport : 'error validating settings: only one positional argument is allowed'

json - 将 JSON 文件导入 mongos

具有 fifo 策略和其他一些条件的 MongoDb : Keeping an array on fixed length inside an object ,?

javascript - meteor .js : how to pass the data context of one helper to another helper?

MongoDB日志: extent 0:550000 and can't find plugin [desc]