簡體   English   中英

StackExchange Redis SortedSetRangeByScoreWithScoresAsync獲取前n個元素

[英]StackExchange Redis SortedSetRangeByScoreWithScoresAsync Get Top n Elements

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

我正在使用排序集作為數據存儲。 以下redis命令在StackExchange.Redis中的等效方法是什么:

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

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

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

*Async twin:

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

請注意未指定的startstopexcludeskip附加參數,因為它們已經具有適當的值。 如果不清楚,則exclude(范圍上的前綴有關,如ZRANGEBYSCORE

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM