Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用Python SDK按RowKey和StartsWith筛选Azure表存储_C#_Python_Rest_Azure_Azure Table Storage - Fatal编程技术网

C# 使用Python SDK按RowKey和StartsWith筛选Azure表存储

C# 使用Python SDK按RowKey和StartsWith筛选Azure表存储,c#,python,rest,azure,azure-table-storage,C#,Python,Rest,Azure,Azure Table Storage,我已经看到Azure表存储支持通过部分RowKey(除了PartitionKey)查询记录(C#示例) 但是,我在过滤查询结果()的实际文档中找不到与此相关的任何内容 我试图使用Python Azure存储SDK查询分区键和行键组合的子集,其中行键以特定字符串开头。我有代码(可以工作,但不能正确过滤任何行键): 但是,我无法理解向过滤器添加部分(startswith)约束的语法 有没有人有过通过部分行键字符串过滤Azure表存储查询的经验?我在这里不知所措;但是,通过上例中的C#代码似乎是可能的

我已经看到Azure表存储支持通过部分
RowKey
(除了
PartitionKey
)查询记录(C#示例)

但是,我在过滤查询结果()的实际文档中找不到与此相关的任何内容

我试图使用Python Azure存储SDK查询
分区键
行键
组合的子集,其中
行键
以特定字符串开头。我有代码(可以工作,但不能正确过滤任何行键):

但是,我无法理解向过滤器添加部分(
startswith
)约束的语法

有没有人有过通过部分
行键
字符串过滤Azure表存储查询的经验?我在这里不知所措;但是,通过上例中的
C#
代码似乎是可能的


如果有任何关于如何通过REST调用执行此操作的额外文档,我可能会将其转换为Python用法。

假设您的RowKey值包含单词,并且您只想筛选以
a
b
开头的单词,您将向查询中添加以下内容:

(RowKey ge 'a' and RowKey lt 'c') ==> (RowKey >= 'a' && RowKey < 'c')
(RowKey ge'a'和RowKey lt'c')=>(RowKey>='a'和&RowKey<'c'))
因此,您的代码类似于:

entities = table_service.query_entities('mystoragetable', filter="PartitionKey eq 'mypartitionkey' and RowKey ge '<starts with substring>'", num_results=10)
entities=table\u service.query\u entities('mystoragetable',filter=“PartitionKey eq'mypartitionkey'和RowKey ge'',num\u results=10)

这非常有用。我没有领会
ge
le
也可以应用于字符的概念,但我认为这是非常有意义的。谢谢
entities = table_service.query_entities('mystoragetable', filter="PartitionKey eq 'mypartitionkey' and RowKey ge '<starts with substring>'", num_results=10)