mongo 客户端 v 4.4
mongorestore --host <host> --port 10255 -u <user> -p <password> --db <db_name> --collection structures structures.bson --ssl --sslAllowInvalidCertificates
2020-10-03T23:13:44.440+0300 Failed: <db_name>.structures: error restoring from structures.bson: (BadValue) Retryable writes are not supported. Please disable retryable writes by specifying "retrywrites=false" in the connection string or an equivalent driver specific config.
我试过另一种方式mongorestore "mongodb://<host>:<password>@<name>:10255/?ssl=true&retrywrites=false&appName=@name@" dump/
有同样的错误。
最佳答案
我发现this command --writeConcern="{w:0}"
可以解决“rewrite=false”错误。我已经试过了,这是我的命令。
mongorestore.exe --uri "<cosmosdb_connect_string>" --db Database1 --collection collection1 --ssl --sslAllowInvalidCertificates edx-dump/Database1/collection1.bson --writeConcern {w:0}
关于mongodb - 从本地主机到 cosmosDb 的 Mongorestore 失败, "disable retryable writes by specifying "retrywrites=false”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64188655/