Skip to content

SortDirection

概览

字段
KindEnum · 枚举 Enum
Realmserver
  • Inherit: Int
  • 继承链: Int → SortDirection

SortDirection 枚举定义 MemoryStoreSortedMap 范围查询的排序方向,Ascending 表示按排序键升序返回,Descending 表示按排序键降序返回。

适用场景

调用 MemoryStoreSortedMap:GetRangeAsync(direction, count, options) 获取排序映射分页结果时,使用该枚举控制返回顺序。

使用要点

通过 Enums.SortDirection.Ascending 或 Enums.SortDirection.Descending 作为 GetRangeAsync 的第一个参数,例如 sortedMap:GetRangeAsync(Enums.SortDirection.Descending, 10, options)。

注意事项

GetRangeAsync 的公开签名是 direction、count、options;上下界等过滤条件放在 MemoryStoreSortedMapGetRangeOptions 中,不要把 lowerBound、upperBound 当作额外位置参数传入。

枚举值

名称说明
1Ascending升序 (ASC)
-1Descending降序 (DESC)