【发布时间】:2018-11-30 05:39:01
【问题描述】:
我正在尝试将 hangfire 与 Azure Cosmos DB 连接,但出现异常
MongoDB.Driver.MongoCommandException: 'Command renameCollection failed: Command is not supported.' 在GlobalConfiguration.Configuration.UseMongoStorage。
当我尝试连接 Azure VM 托管的 MongoDB 时,它工作正常。
【问题讨论】:
-
无法重命名 Cosmos DB 的集合。因此,除了在后台在集合之间复制内容(这可能既昂贵又耗时,具体取决于源集合的大小)之外,将无法通过 Cosmos DB 的 MongoDB API 支持重命名。您提到的虚拟机托管的 MongoDB 使用的是本机 MongoDB 引擎,它将为您提供 100% 的 MongoDB 功能集(但它是 Cosmos DB 的独立产品)。
标签: mongodb azure azure-cosmosdb hangfire