mongodb - 从本地主机到 cosmosDb 的 Mongorestore 失败, "disable retryable writes by specifying "retrywrites=false”

标签 mongodb azure-cosmosdb azure-cosmosdb-mongoapi

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}
enter image description here

关于mongodb - 从本地主机到 cosmosDb 的 Mongorestore 失败, "disable retryable writes by specifying "retrywrites=false”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64188655/

相关文章:

java - 使用 Azure Functions 删除 cosmos DB 项目

azure-cosmosdb - 如何为 Mongodb API 禁用 Cosmos DB 分片键

azure - 写入 Azure Cosmos,吞吐量 RU

mongodb - 如何使用 MongoDB API 在 Azure CosmosDB 上创建插入触发器

mongodb - 在 Golang 的 mongodb 中插入结构

windows - 在 Windows 中使用 mongodb.config 设置 mongodb 配置路径

node.js - 获取代表现在(当前时间)的时间戳用于查询mongodb oplog

node.js - MongoDB 版本 4^ -- 获取 Node js 中所有数据库的列表

.net - 如何配置 Cosmos DB .NET 3.0 SDK 以使用驼峰式大小写进行序列化?

azure - 是否可以禁用 Azure CosmosDB 存储过程的 5 秒时间限制