ZRANGEBYLEX

Redis 開発者教育の申込 Redis 定期点検/技術サポート
Redis Technical Support
Redis エンタープライズサーバー
Redis Enterprise Server

member で範囲を指定して照会

使い方は zrangebylex key min max です。
min、max は member の範囲です。すべて照会するには -, + を使います。
min、max に値を付ける場合は必ず前に [ または ( を使う必要があります。
[ は値を含むときに使い、( は除外するときに使います。
このコマンドは score がすべて同じでなければ望む結果を得られません。
このコマンドには withscores オプションがありません。

Example

コマンド>zrangebylex city - +
結果> 0) Beijing
1) New Delhi
2) New York
3) Seoul
コマンド>zrangebylex city "[New Delhi" +
結果> 0) New Delhi
1) New York
2) Seoul
コマンド>zrangebylex city "(New Delhi" +
結果> 0) New York
1) Seoul
コマンド>zrangebylex city "(New Delhi" "(Seoul"
結果> 0) New York

アニメーションを見る


limit offset count の使用

使い方は zrangebylex key min max limit offset count です。
offset は開始点を示し、count は照会する member の個数です。
offset は 0 から始められ、count は 1 以上でなければなりません。0 だと照会されません。
limit がある場合は offset count の両方が必要です。
ページ別照会に便利です。<

Example

コマンド>zrangebylex city - + limit 0 2
結果> 0) Beijing
1) New Delhi
コマンド>zrangebylex city - + limit 2 2
結果> 0) New York
1) Seoul

アニメーションを見る



構文

ZRANGEBYLEX key min max [limit offset count]

  • このコマンドは version 2.8.9 から使用できます。
  • 時間計算量は O(log(N)+M) です。 N は集合に属する member 個数で、 M は返される member 個数です。
関連コマンド ZRANGE, ZREVRANGE, ZREVRANGEBYSCORE, LRANGE
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< ZREVRANGEBYSCORE ZRANGEBYLEX ZREVRANGEBYLEX >>

Email 返事がかかってなれば、メールでお知らせします。