从 localhost 到 cosmosDb 的 Mongorestore 失败,并显示“通过指定“retrywrites=false”禁用可重试写入”

2024-01-07

蒙戈客户端 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/

有同样的错误。


我找到这个命令 https://stackoverflow.com/a/65336889/14574199 --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}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从 localhost 到 cosmosDb 的 Mongorestore 失败,并显示“通过指定“retrywrites=false”禁用可重试写入” 的相关文章

随机推荐