作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要使用 Azure 表存储执行诸如批量获取之类的操作。我有一个已知 RowKey 和 PartitionKey 的列表,我想检索每一个。
我想知道是否有比单独查询每个实体更好的方法 - 比如批量 GET。
在 this answer ,有一个建议的解决方案:
TableQuery<DynamicTableEntity> query = new TableQuery<DynamicTableEntity>()
.Where(TableQuery.CombineFilters(
TableQuery.GenerateFilterCondition("PartitionKey",
QueryComparisons.Equal, "partition1"),
TableOperators.And,
TableQuery.CombineFilters(
TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, "row1"),
TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, "row2"))));
但另一个答案提到:
There is (or course) a URL length limitation to the query. If you exceed the length, the query will still succeed because the service can not tell that the URL was truncated. In our case, we limited the combined query length to about 2500 characters (URL encoded!)
有没有办法知道表查询有多长?或者使用建议的答案安全地查询表的解决方案?
最佳答案
根据 Azure 存储文档,$filter 中只允许进行 15 次比较。
https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities
关于azure - TableQuery.CombineFilters 中 FilterCondition 的最大数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47960272/
如何为使用 AND 和 foreach 循环附加条件的 myQuery 分配初始值。 我正在尝试执行以下操作: string myQuery = string.empty; foreach (stri
我需要使用 Azure 表存储执行诸如批量获取之类的操作。我有一个已知 RowKey 和 PartitionKey 的列表,我想检索每一个。 我想知道是否有比单独查询每个实体更好的方法 - 比如批量
我是一名优秀的程序员,十分优秀!