首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >仅Cosmos DB表应用编程接口索引PartitionKey和RowKey

仅Cosmos DB表应用编程接口索引PartitionKey和RowKey
EN

Stack Overflow用户
提问于 2018-11-23 10:31:57
回答 1查看 279关注 0票数 0

使用Cosmos DB中的TablesDB表,我尝试只对PartitionKey和RowKey进行索引。

下面的CosmosDB索引可以正确编译,但是当我在分区键/行键上运行查询时,我收到了错误消息"An invalid query has specified with filters a a path(s) excluded from index .考虑在请求中添加allow scan header。“

有人知道如何使用只对PartitionKey和RowKey进行索引而不对其他内容进行索引的CosmosDB TablesDB吗?

代码语言:javascript
复制
{
    "indexingMode": "consistent",
    "automatic": true,
    "includedPaths": [
        {
            "path": "/PartitionKey/?",
            "indexes": [
                {
                    "kind": "Hash",
                    "dataType": "String",
                    "precision": -1
                },
                {
                    "kind": "Range",
                    "dataType": "Number",
                    "precision": -1
                }
            ]
        },
        {
            "path": "/RowKey/?",
            "indexes": [
                {
                    "kind": "Range",
                    "dataType": "String",
                    "precision": -1
                },
                {
                    "kind": "Range",
                    "dataType": "Number",
                    "precision": -1
                }
            ]
        }
    ],
    "excludedPaths": [
        {
            "path": "/*"
        }
    ]
}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53439991

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档