对 Apply with Aggregate OData Version 4 的结果执行 OrderBy

Perform OrderBy on the results of Apply with Aggregate OData Version 4

假设我有一个这样的 odata 查询:

Sessions?$apply=filter(SomeColumn eq 1)/groupby((Application/Name), aggregate(TotalLaunchesCount with sum as Total))

会话和应用程序实体由 ApplicationId 链接。我想在 "Total" 上应用 orderby 并获得前 5 个结果作为 odata 查询响应。

我尝试在上述查询的末尾添加 &$top=5。它说:

The query specified in the URI is not valid. Could not find a property named 'Total' on type 'Sessions'.

谁能告诉我是否支持这样的查询?

支持。 $skip、$top、$orderby 在 $apply 链的结果上 "performed"。 在这种情况下,查询应如下所示:

Sessions?$apply=filter(SomeColumn eq 1)
/groupby((Application/Name), aggregate(TotalLaunchesCount with sum as Total))
&$orderby=Total
&$top=5

3.15 Evaluating $apply