zrank
ZRANK by index
Redis 開発者教育Redis Developer Course |
Redis 定期点検/技術支援Redis Technical Support |
Redis エンタープライズサーバRedis Enterprise Server |
|---|
memberのindex(rank)をリターン
使い方は zrank key member です。
リターンの値はindexです。 lrangeで使用するindexと同じ概念です。
scoreの順でindex(rank)が定められば0から始めます。 scoreが同じばmemberと比較してindexを定めます。
Example
| コマンド> | zrange city 0 -1 withscores |
| 結果> |
0) 50 -> Tokyo 1) 60 -> Seoul 2) 70 -> Beijing 3) 80 -> New York |
| コマンド> | zrank city "Tokyo" |
| 結果> | 0 |
| コマンド> | zrank city "New York" |
| 結果> | 3 |
コマンド
ZRANK key member
- このコマンドはversion 2.0.0から使用することができます。
- 論理的処理の所要時間はO(log(N)+M)です。
| 関連コマンド | ZREVRANGE, LRANGE |
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis |
| << ZLEXCOUNT | ZRANK | ZREVRANK >> |
|---|
クリック件数 :
Email
返事がかかってなれば、メールでお知らせします。
