SrandmemberCommand: Contents
  SRANDMEMBER _key_
    Return value

SrandmemberCommand

#sidebar SetCommandsSidebar

SRANDMEMBER _key_

Time complexity O(1)
Return a random element from a Set, without removing the element. If the Set is empty or the key does not exist, a nil object is returned.
The SPOP command does a similar work but the returned elementis popped (removed) from the Set.

Return value

Bulk reply