If key already exists and is a string, this command appends the value at the end of the string.
If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
cache storage key
value to be appended
number of characters of current value
Determines whether value exists in cache.
Determines whether value exists in cache.
cache storage key
record existence, true if exists, otherwise false
refreshes expiration time on a given key, useful, e.g., when we want to refresh session duration
refreshes expiration time on a given key, useful, e.g., when we want to refresh session duration
cache storage key
new expiration in seconds
promise
returns the remaining time to live of a key that has an expire set, useful, e.g., when we want to check remaining session duration
returns the remaining time to live of a key that has an expire set, useful, e.g., when we want to check remaining session duration
cache storage key
the remaining time to live of a key in milliseconds
Retrieve a value from the cache.
Retrieve a value from the cache.
cache storage key
stored record, Some if exists, otherwise None
Returns if field is an existing field in the hash stored at key.
Returns if field is an existing field in the hash stored at key.
Time complexity: O(1)
cache storage key
tested field name
true if the field exists, false otherwise
Returns the values associated with fields in the hash stored at given keys.
Returns the values associated with fields in the hash stored at given keys.
Time complexity: O(n), where n is number of fields
cache storage key
accessed fields to get
Some value if the field exists, otherwise None
Returns the value associated with field in the hash stored at key.
Returns the value associated with field in the hash stored at key.
Time complexity: O(1)
cache storage key
accessed field
Some value if the field exists, otherwise None
Returns all fields and values of the hash stored at key.
Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash.
Time complexity: O(N) where N is the size of the hash.
expected type of the elements
cache storage key
the stored map
Increment a value at the given key in the map
Increment a value at the given key in the map
cache storage key
key
increment by this
value after incrementation
Returns all field names in the hash stored at key.
Returns all field names in the hash stored at key.
Time complexity: O(N) where N is the size of the hash.
cache storage key
set of field names
Removes the specified fields from the hash stored at key.
Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored. If key does not exist, it is treated as an empty hash and this command returns 0.
Time complexity: O(N) where N is the number of fields to be removed.
cache storage key
fields to be removed
the number of fields that were removed from the hash, not including specified but non existing fields.
Sets field in the hash stored at key to value.
Sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten.
Time complexity: O(1)
cache storage key
field to be set
value to be set
true if the field was newly set, false if was updated
Returns the number of fields contained in the hash stored at key.
Returns the number of fields contained in the hash stored at key.
Time complexity: O(1)
cache storage key
size of the hash
Returns all values in the hash stored at key.
Returns all values in the hash stored at key.
Time complexity: O(N) where N is the size of the hash.
cache storage key
all values in the hash object
Increments the stored string value representing 10-based signed integer by given value.
Increments the stored string value representing 10-based signed integer by given value.
cache storage key
size of increment
the value after the increment
Remove all keys in cache
Remove all keys in cache
promise
Insert (RPUSH) all the specified values at the tail of the list stored at key.
Insert (RPUSH) all the specified values at the tail of the list stored at key. If key does not exist, it is created as empty list before performing the push operation. When key holds a value that is not a list, an error is returned.
Time complexity: O(1)
cache storage key
appended values
new length of the list
Removes and returns the first element of the list stored at key (LPOP).
Removes and returns the first element of the list stored at key (LPOP).
Time complexity: O(1)
type of the value
cache storage key
head of the list, if existed
Inserts value in the list stored at key either before or after the reference value pivot.
Inserts value in the list stored at key either before or after the reference value pivot. When key does not exist, it is considered an empty list and no operation is performed. An error is returned when key exists but does not hold a list value.
Time complexity: O(N) where N is the number of elements to traverse before seeing the value pivot.
cache storage key
value used as markup
value to be inserted
the length of the list after the insert operation, or None when the value pivot was not found.
Insert (LPUSH) all the specified values at the head of the list stored at key.
Insert (LPUSH) all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.
Time complexity: O(1)
cache storage key
prepended values
new length of the list
Removes (LREM) the first count occurrences of elements equal to value from the list stored at key.
Removes (LREM) the first count occurrences of elements equal to value from the list stored at key. The count argument influences the operation in the following ways: count > 0: Remove elements equal to value moving from head to tail. count < 0: Remove elements equal to value moving from tail to head. count = 0: Remove all elements equal to value.
cache storage key
value to be removed
number of elements to be removed
number of removed elements
Sets the list element at index to value.
Sets the list element at index to value. For more information on the index argument, see LINDEX. An error is returned for out of range indexes.
Time complexity: O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1).
cache storage key
position to be overwritten
value to be set
promise
Returns the length of the list stored at key (LLEN).
Returns the length of the list stored at key (LLEN). If key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at key is not a list.
Time complexity: O(1)
cache storage key
length of the list
Returns the specified elements of the list stored at key (LRANGE).
Returns the specified elements of the list stored at key (LRANGE). The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on.
These offsets can also be negative numbers indicating offsets starting at the end of the list. For example, -1 is the last element of the list, -2 the penultimate, and so on.
Time complexity: O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range.
type of the values
cache storage key
initial index of the subset
last index of the subset (included)
subset of existing set
Trim an existing list so that it will contain only the specified range of elements specified.
Trim an existing list so that it will contain only the specified range of elements specified. Both start and stop are zero-based indexes, where 0 is the first element of the list (the head), 1 the next element and so on.
For example: LTRIM foobar 0 2 will modify the list stored at foobar so that only the first three elements of the list will remain. start and end can also be negative numbers indicating offsets from the end of the list, where -1 is the last element of the list, -2 the penultimate element and so on.
Time complexity: O(N) where N is the number of elements to be removed by the operation.
cache storage key
initial index of preserved subset
last index of preserved subset (included)
promise
Retrieve a values from the cache.
Retrieve a values from the cache.
cache storage key
stored record, Some if exists, otherwise None
Set a value into the cache.
Set a value into the cache. Expiration time is the eternity.
cache storage key-value pairs to store
promise
Set a value into the cache.
Set a value into the cache. Expiration time is the eternity. It either set all values or it sets none if any of them already exists.
cache storage key-value pairs to store
promise
Retrieves all keys matching the given pattern.
Retrieves all keys matching the given pattern. This method invokes KEYS command
Warning: complexity is O(n) where n are all keys in the database
valid KEYS pattern with wildcards
list of matching keys
Sends PING command to REDIS and expects PONG in return
Sends PING command to REDIS and expects PONG in return
promise
Removes all keys in arguments.
Removes all keys in arguments. The other remove methods are for syntax sugar
cache storage keys
promise
Set a value into the cache.
Set a value into the cache. Expiration time in seconds (0 second means eternity).
cache storage key
value to store
record duration in seconds
set only if the key does not exist
promise
Add the specified members to the set stored at key.
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.
An error is returned when the value stored at key is not a set.
cache storage key
values to be added
number of inserted elements ignoring already existing
Time complexity: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments.
Returns if member is a member of the set stored at key.
Returns if member is a member of the set stored at key.
Time complexity: O(1)
cache storage key
tested element
true if the element exists in the set, otherwise false
Returns all the members of the set value stored at key.
Returns all the members of the set value stored at key.
This has the same effect as running SINTER with one argument key.
Time complexity: O(N) where N is the set cardinality.
expected type of the elements
cache storage key
the subset
Remove the specified members from the set stored at key.
Remove the specified members from the set stored at key. Specified members that are not a member of this set are ignored. If key does not exist, it is treated as an empty set and this command returns 0.
An error is returned when the value stored at key is not a set.
Time complexity: O(N) where N is the number of members to be removed.
cache storage key
values to be removed
total number of removed values, non existing are ignored
Returns the set cardinality (number of elements) of the set stored at key.
Returns the set cardinality (number of elements) of the set stored at key.
Time complexity: O(1)
cache storage key
the cardinality (number of elements) of the set, or 0 if key does not exist.
Internal non-blocking Redis API implementing REDIS protocol
https://redis.io/commands