英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论