RedisSet
Redis Sets are simply unsorted sets of objects. It is possible to add elements to a Redis Set by adding new elements into the collection.
This simplified wrapper implements only unordered Sets.
Type parameters
- Elem
-
Data type of the inserted element
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
Add the specified members to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members.
Add the specified members to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members.
Value parameters
- element
-
elements to be added
Attributes
- Returns
-
the set for chaining calls
- Note
-
An error is returned when the value stored at key is not a set.
Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
Tests if the element is contained in the set. Returns true if exists, otherwise returns false
Tests if the element is contained in the set. Returns true if exists, otherwise returns false
Value parameters
- element
-
tested element
Attributes
- Returns
-
true if exists in the set, otherwise false
- Note
-
Time complexity: O(1)
Removes the specified members from the sorted set stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted set.
Removes the specified members from the sorted set stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted set.
Value parameters
- element
-
elements to be removed
Attributes
- Returns
-
the set for chaining calls
- Note
-
Time complexity: O(N) where N is the number of members to be removed.
Returns all elements in the set
Returns all elements in the set
Attributes
- Returns
-
all elements in the set
- Note
-
Time complexity: O(N) where N is the set cardinality.
Inherited methods
Attributes
- Inherited from:
- RedisCollection (hidden)
Attributes
- Inherited from:
- RedisCollection (hidden)
Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.
Returns the length of the collection stored at key. If key does not exist, it is interpreted as an empty collection and 0 is returned. An error is returned when the value stored at key is not a proper collection.
Time complexity: O(1)
Attributes
- Returns
-
size of the list
- Inherited from:
- RedisCollection (hidden)