redis SPOP command


  Translation results:

pop

UK[pɒp] US[pɑ:p]

vi. (unexpectedly, suddenly) appear; appear suddenly; make a popping sound; (suddenly) action

vt. (suddenly) reach out; (suddenly) ask a question; (suddenly take out something prepared); strike

n.pop music ; soda; (especially used as a title) dad; (quickly marked)

adj. pop music; popular style; popular; modern

adv. explosion; bang

abbr.post office protocol

Third person singular: pops Plural: pops Present participle: popping Past tense: popped Past participle: popped


redis SPOP commandsyntax

Function: Remove and return a random element in the collection.

Syntax: SPOP key

Description: If you only want to get a random element, but do not want the element to be removed from the collection, You can use the SRANDMEMBER command.

Available versions: >= 1.0.0

Time complexity: O(1)

Returns: The random element that was removed. When key does not exist or key is the empty set, nil is returned.

redis SPOP commandexample

redis> SMEMBERS db
1) "MySQL"
2) "MongoDB"
3) "Redis"
redis> SPOP db
"Redis"
redis> SMEMBERS db
1) "MySQL"
2) "MongoDB"
redis> SPOP db
"MySQL"
redis> SMEMBERS db
1) "MongoDB"

Home

Videos

Q&A