简体   繁体   English

具有正则表达式的Azure TableQuery

[英]Azure TableQuery With Regular Expressions

Is there a way to query Azure for PartitionKeys that match a certain regular expression instead of just equality? 有没有办法查询Azure的PartitionKeys匹配某个正则表达式而不仅仅是相等?

For example: 例如:

My Azure Storage Table PartitionKeys: CA94568, CA92122, CA92092, WA98005 我的Azure存储表分区键:CA94568,CA92122,CA92092,WA98005

Sample Query #1: 示例查询#1:

tableQuery = new TableQuery<Entry>().Where(TableQuery.GenerateFilterCondition(PartitionKey, QueryComparisons.Equal??,  "CA.*"));

Query Results #1: "CA94568, CA92122, CA92092" 查询结果#1:“CA94568,CA92122,CA92092”

Sample Query #2: 示例查询#2:

tableQuery = new TableQuery<Entry>().Where(TableQuery.GenerateFilterCondition(PartitionKey, QueryComparisons.Equal??,  "CA92.*"));

Query Results #2: "CA92122, CA92092". 查询结果#2:“CA92122,CA92092”。

I don't believe so. 我不相信。 Azure Table Storage does not support any operations except equal, greater than, or less than. Azure表存储不支持除“等于”,“大于”或“小于”之外的任何操作。 Everything else has to be interpreted on the client side. 其他一切都必须在客户端进行解释。

So you could download of all of the table in memory via ToList and then perform queries as you see fit. 因此,您可以通过ToList下载内存中的所有表,然后根据需要执行查询。

Service side wants to do simple queries. 服务方想要做简单的查询。 Supported comparison operators within $filter clause: $ filter子句中支持的比较运算符:

Equal, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEqual. Equal,GreaterThan,GreaterThanOrEqual,LessThan,LessThanOrEqual,NotEqual。 You can look at the API to learn more. 您可以查看API以了解更多信息。

Please see the details about querying at Querying Tables and Entities 请参阅查询表和实体的查询详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM