2

我在 .NET 应用程序中使用 StackExchange.Redis API 进行分析。

我使用排序集作为数据存储。以下 redis 命令的 StackExchange.Redis 中的等效方法是什么:

ZREVRANGEBYSCORE "KEY:2014052923" +inf -inf withscores Limit 0 10

StackExchange.Redis API 中使用 SortedSetRangeByScoreWithScoresAsync 函数的等效方法是什么?

4

1 回答 1

4
SortedSetEntry[] values = db.SortedSetRangeByScoreWithScores(
    "KEY:2014052923", order: Order.Descending, take: 10);

*Async双胞胎:

SortedSetEntry[] values = await db.SortedSetRangeByScoreWithScoresAsync(
    "KEY:2014052923", order: Order.Descending, take: 10);

请注意,和的附加参数start,因为它们已经具有适当的值,所以我没有指定它们。如果不清楚,则与范围的前缀有关,如.stopexcludeskipexclude(ZRANGEBYSCORE

于 2014-05-30T07:53:43.173 回答