我正在尝试将 mongo 从本地迁移到 map 集。我做了 mongodump,它正确地生成了 .z 存档。
但是,当我尝试如下恢复时:
mongorestore --uri="mongodb+srv://<user>:<password>@xxxxx.ipmg6.mongodb.net/myDbName" --archive=mongodump_2021-05-22_09-05-44.gz --gzip
我看到输出2021-05-23T07:25:01.340+0200 The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}
2021-05-23T07:25:01.350+0200 preparing collections to restore from
2021-05-23T07:25:01.360+0200 0 document(s) restored successfully. 0 document(s) failed to restore.
没有错误,但也没有处理任何文件。知道出了什么问题吗?我有没有来自mongo的错误或警告?
最佳答案
好的解决方案是--nsInclude
失踪。如果想恢复整个数据库,那么 --nsInclude="*"
应该使用。
关于mongodb - mongorestore 0 文档已成功恢复。 0 个文档无法恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67656468/