Adds one or more members to a set.
Adds one or more members to a set.
set key
member(s) to add
the number of members added to the set, not including all the members that were already present
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Returns the number of members in a set.
Returns the number of members in a set.
set key
the cardinality (number of members) of the set, or 0 if key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Returns the set resulting from the difference between the first set and all the successive sets.
Returns the set resulting from the difference between the first set and all the successive sets.
the key of the first set
key(s) of successive set(s) whose members will be substracted from the first one
the resulting set, or the empty set if the first key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if some keys contain a value that is not a set
Stores the set resulting from the difference between the first set and all the successive sets.
Stores the set resulting from the difference between the first set and all the successive sets.
key where to store the resulting set
key of first set
keys of sets to be substracted from first set, if empty, first set is simply copied to destKey
the cardinality of the resulting set
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if some keys contain a value that is not a set
If destKey already exists, it is overwritten.
Intersects multiple sets.
Intersects multiple sets.
keys of sets to be intersected together
the resulting set, or the empty set if the first key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if some keys contain a value that is not a set
Intersects multiple sets and stores the resulting set in a key.
Intersects multiple sets and stores the resulting set in a key.
key where to store the resulting set
keys of sets to be intersected together, if only one is specified, it is simply copied to destKey
the cardinality of the resulting set
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if some keys contain a value that is not a set
If destKey already exists, it is overwritten.
Determines if a given value is a member of a set.
Determines if a given value is a member of a set.
set key
value to be tested
true if the provided value is a member of the set stored at key, false otherwise
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Returns all the members of a set.
Returns all the members of a set.
set key
set stored at key, or the empty set if key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Moves a member from one set to another.
Moves a member from one set to another.
key of source set
value to be moved from source set to destination set
true if the member was moved, false if the element is not a member of source set and no operation was performed
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if sourceKey or destKey contains a value that is not a set
Removes and returns a random member from a set.
Removes and returns a random member from a set.
set key
random member, or None
if key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
This operation is similar to SRANDMEMBER, that returns a random element from a set but does not remove it.
Removes and returns a random 'count' members from a set.
Removes and returns a random 'count' members from a set.
set key
maximum number of returned elements
list of random members which size is less or equal to 'count'
3.2.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
This operation is similar to SRANDMEMBER, that returns a random element from a set but does not remove it.
Returns a random member from a set (without removing it).
Returns a random member from a set (without removing it).
set key
random member, or None
if key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Returns a random member from a set (without removing it).
Returns a random member from a set (without removing it).
set key
number of member to randomly retrieve
set of random members, or the empty set if key does not exist
2.6.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Removes one or more members from a set.
Removes one or more members from a set.
set key
members to remove from set
the number of members that were removed from the set, not including non-existing members
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if key contains a value that is not a set
Redis versions older than 2.4 can only remove one member per call.
Incrementally iterates the elements of a set.
Incrementally iterates the elements of a set.
the offset
when defined, the command only returns elements matching the pattern
when defined, provides a hint of how many elements should be returned
a pair containing the next cursor as its first element and the set of elements as its second element
2.8.0
Computes the union of multiple sets.
Computes the union of multiple sets.
keys of sets to be included in the union computation
the resulting set, or the empty set if the first key does not exist
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if some keys contain a value that is not a set
Computes the union of multiple sets and stores the resulting set in a key.
Computes the union of multiple sets and stores the resulting set in a key.
key where to store the resulting set
keys of sets to be included in the union computation, if only one is specified, it is simply copied to destKey
the cardinality of the resulting set
1.0.0
[[scredis.exceptions.RedisErrorResponseException]]
if some keys contain a value that is not a set
If destKey already exists, it is overwritten.
This trait implements set commands.