Azure开发:可以对存储表进行查询并排序吗?

huangapple go评论80阅读模式
英文:

Azure development : Query from storage table can be sorted?

问题

使用Azure数据表(在C++ CLR中的Azure::Data::Table)和Microsoft.Azure.Cosmos.Table,使用TableEntity,我可以使用如下的代码查询表存储:

Azure::Pageable<TableEntity^>^ response = table->Query<TableEntity^>(filter, maxPerPage, selection, cancellationToken);

System::Collections::Generic::IEnumerator<TableEntity^>^ enumerator = response->GetEnumerator();

我已经尝试设置一些条件的筛选,但是我找不到有关如何对结果进行排序的文档。这是否可能?

英文:

Using Azure Data Table (Azure::Data::Table in C++ CLR) and Microsoft.Azure.Cosmos.Table
using TableEntity, I can query the table storage using lines such as this:

Azure::Pageable<TableEntity^>^ response = table->Query<TableEntity^>(filter, maxPerPage, selection, cancellationToken);

System::Collections::Generic::IEnumerator<TableEntity^>^ enumerator = response->GetEnumerator();

I have tried setting up the filters for some conditions, however I can't find any documentation on how to sort the result. Is it possible?

答案1

得分: 1

服务器端不支持对表存储进行排序。查询结果始终按照分区键(PartitionKey)和行键(RowKey)的值排序。

对于任何类型的排序,您需要获取相关数据并在客户端端进行排序。

英文:

Server side sorting is not supported for Table Storage. Query results are always sorted by PartitionKey and RowKey value.

For any kind of sorting, you would need to fetch the relevant data and do the sorting on client side.

huangapple
  • 本文由 发表于 2023年7月31日 23:49:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76805208.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定