我想从我的.gz
文件导入转储数据。
文件的位置是home/Alex/Documents/Abc/dump.gz
,数据库的名称为"Alex"
。
我尝试了mongorestore --gzip --db "Alex" /home/Alex/Documents/Abc/dump.gz
但它显示错误:
2018-10-31T12:54:58.359+0530 the --db and --collection args should
only be used when restoring from a BSON file. Other uses are
deprecated and will not exist in the future; use --nsInclude instead
2018-10-31T12:54:58.359+0530 Failed: file
/home/Alex/Documents/Abc/dump.gz does not have .bson extension.
我该如何导入它?
json
和bson
文件。对于我来说,使用--gzip
而不使用--db
是失败的。 - mmellmongorestore --host localhost:27017 --gzip --archive=dump.gz --db Alex
这个命令对我不起作用。我得到了与 @SantiagoBendavid 相同的错误。 - Nishat27017
是 MongoDB 的默认端口:https://docs.mongodb.com/manual/reference/default-mongodb-port/index.html - Metafaniel