【问题标题】:Problem to dump and restore mongo database转储和恢复 mongo 数据库的问题
【发布时间】:2020-09-08 10:31:57
【问题描述】:

我像这样在本地转储一个 mongo 数据库:

./mongodump -h <url>:<port> -d <dbname> -u <user> -p <password> -o C:\Users\Manuel\Documents\database 

然后我尝试在另一个数据库中恢复它,例如:

./mongodump -h <otherUrl>:<otherPort> -d <otherdbname> -u <otherUser> -p <otherPassword> -o C:\Users\Manuel\Documents\database

但我得到以下信息:

finished restoring <dbname>.<oneCollection> (0 documents, 0 failures)
Failed: <dbname>.<oneCollection> : error restoring from C:\Users\Manuel\Documents\database\<dbname>\<oneCollection>.bson: this MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string
0 document(s) restored successfully. 0 document(s) failed to restore.

我做错了什么?如何添加retryWritables,我也尝试使用--uri,然后我得到验证失败。

【问题讨论】:

标签: mongodb mongodump mongorestore


【解决方案1】:

我觉得这就是您寻求的答案:Mongorestore to a different database

您需要使用nsFromnsTo

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-10
    • 2017-07-14
    • 1970-01-01
    • 2020-12-28
    • 2021-08-21
    相关资源
    最近更新 更多