- Redis Basics
- Redis - Home
- Redis - Overview
- Redis - Environment
- Redis - Configuration
- Redis - Data types
- Redis Commands
- Redis - Commands
- Redis - Keys
- Redis - Strings
- Redis - Hashes
- Redis - Lists
- Redis - Sets
- Redis - Sorted Sets
- Redis - HyperLogLog
- Redis - Publish Subscribe
- Redis - Transactions
- Redis - Scripting
- Redis - Connections
- Redis - Server
- Redis Advanced
- Redis - Backup
- Redis - Security
- Redis - Benchmarks
- Redis - Client Connection
- Redis - Pipelining
- Redis - Partitioning
- Redis - Java
- Redis - Php
- Redis Useful Resources
- Redis - Quick Guide
- Redis - Useful Resources
- Redis - Discussion
Redis - Set Spop Command
Redis SPOP command is used to remove and return a random member from the set stored at a specified key.
Return Value
String reply, the removed element, or nil when the key does not exist.
Syntax
Following is the basic syntax of Redis SPOP command.
redis 127.0.0.1:6379> SPOP KEY
Example
redis 127.0.0.1:6379> SADD myset1 "hello" (integer) 1 redis 127.0.0.1:6379> SADD myset1 "world" (integer) 1 redis 127.0.0.1:6379> SADD myset1 "bar" (integer) 1 redis 127.0.0.1:6379> SPOP myset1 "bar" redis 127.0.0.1:6379> SMEMBERS myset1 1) "Hello" 2) "world"
redis_sets.htm
Advertisements
To Continue Learning Please Login
Login with Google