将现有mongodb导入Atlas的问题

将现有mongodb导入Atlas的问题,mongodb,command-line,Mongodb,Command Line,刚安装完我的mongodb,发现有一个叫做Atlas的免费服务。启动集群并运行mongodump和mongorestore,如本文所述,但似乎无法使其正常工作 以下是我的shell命令: mongorestore --ssl --db=infovis --host infovis-shard-00-00-nmctc.mongodb.net:27017,infovis-shard-00-01-nmctc.mongodb.net:27017,infovis-shard-00-02-nmctc.mon

刚安装完我的mongodb,发现有一个叫做Atlas的免费服务。启动集群并运行mongodump和mongorestore,如本文所述,但似乎无法使其正常工作

以下是我的shell命令:

mongorestore --ssl --db=infovis --host infovis-shard-00-00-nmctc.mongodb.net:27017,infovis-shard-00-01-nmctc.mongodb.net:27017,infovis-shard-00-02-nmctc.mongodb.net:27017/test?replicaSet=Infovis-shard-0" --authenticationDatabase admin --dir=dump/infovis --username danielbook --password <Password>
mongorestore--ssl--db=infovis--host infovis-shard-00-00-nmctc.mongodb.net:27017,infovis-shard-00-01-nmctc.mongodb.net:27017,infovis-shard-00-02-nmctc.mongodb.net:27017/test?replicaSet=infovis-shard-0”--身份验证数据库管理员--dir=dump/infovis--用户名danielbook--密码
我做错了什么


编辑:通过在服务器上运行mongoimport解决了这个问题。

因此,我通过使用
mongoimport
解决了这个问题。我刚刚在mongo中创建了数据库,所以我可以使用相同的csv文件,然后使用

mongoimport-h cluster0-shard-00-00-nmctc.mongodb.net:27017-d infovis-c flights-u-p-file march_2016.csv-type csv-headerline


对于要导入Atlas数据库的每个文件。

因此,我通过使用
mongoimport
解决了这个问题。我刚刚在mongo中创建了数据库,因此我可以使用相同的csv文件,然后使用

mongoimport-h cluster0-shard-00-00-nmctc.mongodb.net:27017-d infovis-c flights-u-p-file march_2016.csv-type csv-headerline


对于我要导入Atlas数据库的每个文件。

您正在运行哪个特定版本的
mongorestore
(即
mongorestore--version
)当您尝试运行该命令时,该命令的错误消息或输出是什么?没有实际的错误消息,它在终端中运行,没有输出。通过运行mongimport解决了问题。如果您可以通过运行
mongoimport
解决问题,则您的备份必须为文本格式(即由
mongoexport
创建)而不是
mongodump
的二进制格式。如果您想发布解决方案作为答案,您应该详细说明备份和恢复的实际步骤。您正在运行的
mongorestore
的具体版本是什么(即
mongorestore--version
)当您尝试运行该命令时,该命令的错误消息或输出是什么?没有实际的错误消息,它在终端中运行,没有输出。通过运行mongimport解决了问题。如果您可以通过运行
mongoimport
解决问题,则您的备份必须为文本格式(即由
mongoexport
创建)而不是
mongodump
的二进制格式。如果您想发布解决方案作为答案,您应该详细介绍备份和恢复的实际步骤。