Redis – Set Sscan Command

  • Post author:
  • Post category:Redis
  • Post comments:0 Comments

Redis SSCAN command iterates the elements of a set stored at a specified key.

Return Value

Array reply.

Syntax

Following is the basic syntax of Redis SSCAN command.

redis 127.0.0.1:6379> SSCAN KEY [MATCH pattern] [COUNT count]

Example

redis 127.0.0.1:6379> SADD myset1 "hello" 
(integer) 1 
redis 127.0.0.1:6379> SADD myset1 "hi" 
(integer) 1 
redis 127.0.0.1:6379> SADD myset1 "bar" 
(integer) 1 
redis 127.0.0.1:6379> sscan myset1 0 match h* 
1) "0" 
2) 1) "hello" 
   2) "h1"

Leave a Reply