问题描述
我这样在本地转存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,然后身份验证失败。
解决方法
我觉得这是您寻求的答案:Mongorestore to a different database
您需要使用nsFrom
和nsTo
。