简体   繁体   English

在Azure表存储中,是否可以使用.NET Core查询属性的子字符串?

[英]In Azure Table Storage, is it possible to query a substring of a property with .NET Core?

In my Azure Table I have a string property called "Labels" that looks something like this (A Json serialization of List): 在我的Azure表中,我有一个字符串属性 "Labels" ,看起来像这样(List的Json序列化):

["value1","value2","value3","value4"]

Is it possible to query the table for all the entries that contain the substring "value3" in the Labels property? 是否可以在表中查询Labels属性中包含子字符串"value3"所有条目?

If you are looking for something like wildcard search eg message like '%SysFn%' , it is not feasible at this moment, You can find all the supported operations below 如果您正在寻找通配符搜索之类的内容, eg message like '%SysFn%' ,目前尚不可行,您可以在下面找到所有受支持的操作

https://docs.microsoft.com/en-us/rest/api/storageservices/Querying-Tables-and-Entities?redirectedfrom=MSDN https://docs.microsoft.com/zh-cn/rest/api/storageservices/Querying-Tables-and-Entities?redirectedfrom=MSDN

在此处输入图片说明 Yes, you can filter by any attribute. 是的,您可以按任何属性进行过滤。 However please keep in mind that only PartitionKey and RowKey are indexed so any query operation which doesn't include at least PartitionKey will result in full table scan. 但是请记住,只有PartitionKey和RowKey被索引,因此任何不至少包含PartitionKey的查询操作都将导致全表扫描。 This will become an issue if your table contains lots of entities. 如果您的表包含许多实体,这将成为一个问题。

Hope it helps. 希望能帮助到你。

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

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