通过REST api对行键的Azure表存储范围查询返回错误请求

通过REST api对行键的Azure表存储范围查询返回错误请求,azure,azure-table-storage,Azure,Azure Table Storage,在对Azure表存储api的ajax请求中,我指定以下url url:'https://myaccount.table.core.windows.net/mytable(PartitionKey=\'2016-01-12_1\')?$filter=RowKey+ge+1', 这会得到错误的请求响应。我尝试了一些修改,比如在过滤器中的单词之间使用纯空白,或者使用%20,但结果是一样的 我确信这个分区存在,即包含大于1的值 如果url的格式为: url:'https://myaccount.tab

在对Azure表存储api的ajax请求中,我指定以下url

url:'https://myaccount.table.core.windows.net/mytable(PartitionKey=\'2016-01-12_1\')?$filter=RowKey+ge+1',
这会得到错误的请求响应。我尝试了一些修改,比如在过滤器中的单词之间使用纯空白,或者使用
%20
,但结果是一样的

我确信这个分区存在,即包含大于1的值

如果url的格式为:

url:'https://myaccount.table.core.windows.net/mytable(PartitionKey=\'2016-01-12_1\',RowKey=\'someValue\'),

然后它就起作用了。但我不能让它与过滤器一起工作。你知道哪里出了问题吗?

我相信你用错了。如果在括号中指定
PartitionKey
,则必须在括号中使用
RowKey
。你不能把这两个选项混在一起

发件人:

因为PartitionKey和RowKey属性构成实体的 主键,您可以使用特殊语法来标识实体,如下所示 如下:

如果要在
RowKey
上筛选某些
PartitionKey
值,则必须仅在
$filter
中指定
PartitionKey
。因此,您的请求URL将是:

https://myaccount.table.core.windows.net/mytable()?$filter=PartitionKey eq 'PartitionKeyValue' and RowKey ge 'RowKeyValue'
https://myaccount.table.core.windows.net/mytable()?$filter=PartitionKey eq 'PartitionKeyValue' and RowKey ge 'RowKeyValue'