【问题标题】:Azure cosmos DB 3.6 Mongo doesn't support Compound index that has embedded fieldAzure cosmos DB 3.6 Mongo 不支持具有嵌入字段的复合索引
【发布时间】:2020-03-23 13:18:08
【问题描述】:

当我在 Cosmos DB 3.6 中运行以下命令时,

db.collectionName.ensureIndex({"Contract.ContractNumber":1, "PBPNumber":1})

Contract.ContractNumber是子文档路径。

我得到了他的错误

{
   "ok" : 0,
   "errmsg" : "Compound index does not currently support nested documents or arrays.",
   "code" : 115,
   "codeName" : "CommandNotSupported"
}

相同的命令在开箱即用的 Mongo 中成功。

还有办法吗?

谢谢

【问题讨论】:

    标签: mongodb indexing field azure-cosmosdb


    【解决方案1】:

    根据CommandNotSupported 错误消息,目前不完全支持该功能。

    据我所知,CosmosDB 仅支持 MongoDB API 的一个子集。 CosmosDB 有一些不同的行为和结果。但是 CosmosDB 有责任改进他们对 MongoDB 的仿真。

    当然,您可以在此处添加 feedback 以提交您的要求。或者如果您想要完整的 MongoDB 功能支持,您可以考虑在 Azure 上使用 MongoDB Atlas。

    【讨论】:

    猜你喜欢
    • 2018-01-06
    • 1970-01-01
    • 2023-02-21
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多