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.
If it sets new value, it subsequently calls EXPIRE to set required expiration time
cache storage key
value to append
record duration, applies only when appends to nothing
promise
Decrements the stored string value representing 10-based signed integer by given value.
Decrements the stored string value representing 10-based signed integer by given value.
cache storage key
size of decrement
the value after the decrement
1.3.0
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
Retrieve a value from the cache.
Retrieve a value from the cache.
cache storage key
stored record, Some if exists, otherwise None
Retrieve the values of all specified keys from the cache.
Retrieve the values of all specified keys from the cache.
cache storage keys
stored record, Some if exists, otherwise None
Retrieve a value from the cache.
Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.
Lazy invocation (default): The method **does wait** for the result of
set
and when it fails, it applies the recovery policy.
Eager invocation: The method **does not wait** for the result of set
if the value is not cached and also does not apply recovery policy if
the set
fails.
cache storage key
expiration period in seconds.
The default function to invoke if the value was not found in cache.
stored or default record, Some if exists, otherwise None
Retrieve a value from the cache.
Retrieve a value from the cache. If is missing, set default value with given expiration and return the value.
Lazy invocation (default): The method **does wait** for the result of
set
and when it fails, it applies the recovery policy.
Eager invocation: The method **does not wait** for the result of set
if the value is not cached and also does not apply recovery policy if
the set
fails.
cache storage key
expiration period in seconds.
The default function to invoke if the value was not found in cache.
stored or default record, Some if exists, otherwise None
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
1.3.0
Remove all keys in cache
Remove all keys in cache
promise
Scala wrapper around Redis list-related commands.
Scala wrapper around Redis list-related commands. This simplifies use of the lists.
type of elements within the list
the key storing the list
Scala wrapper
Scala wrapper around Redis hash-related commands.
Scala wrapper around Redis hash-related commands. This simplifies use of the hashes, i.e., maps.
type of elements within the map
the key storing the map
Scala wrapper
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
Remove all values from the cache
Remove all values from the cache
cache storage key
cache storage key
cache storage keys
promise
Remove a value under the given key from the cache
Remove a value under the given key from the cache
cache storage key
promise
Removes all keys in arguments.
Removes all keys in arguments. The other remove methods are for syntax sugar
cache storage keys
promise
Removes all keys matching the given pattern.
Removes all keys matching the given pattern. This command has no direct support in Redis, it is combination of KEYS and DEL commands.
KEYS pattern
command finds all keys matching the given patternDEL keys
expires all of themThis is usable in scenarios when multiple keys contains same part of the key, such as
record identification, user identification, etc. For example, we may have keys such
as 'page/$id/header', 'page/$id/body', 'page/$id/footer' and we want to remove them
all when the page is changed. We use the benefit of the naming convention we use and
execute removeAllMatching( s"page/$id/*" )
, which invalidates everything related to
the given page. The benefit is we do not need to maintain the list of all keys to invalidate,
we invalidate them all at once.
Warning: complexity is O(n) where n are all keys in the database
this must be valid KEYS pattern
nothing
Scala wrapper around Redis set-related commands.
Scala wrapper around Redis set-related commands. This simplifies use of the sets.
type of elements within the set
the key storing the set
Scala wrapper
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
promise
Sets the given keys to their respective values for eternity.
Sets the given keys to their respective values for eternity. If any value is null, the particular key is excluded from the operation and removed from cache instead. The operation is atomic when there are no nulls. It replaces existing values.
cache storage key-value pairs to store
promise
Sets the given keys to their respective values for eternity.
Sets the given keys to their respective values for eternity. It sets all values if none of them exist, if at least a single of them exists, it does not set any value, thus it is either all or none. If any value is null, the particular key is excluded from the operation and removed from cache instead. The operation is atomic when there are no nulls.
cache storage key-value pairs to store
true if value was set, false if any value already existed before
Set a value into the cache if the given key is not already used, otherwise do nothing.
Set a value into the cache if the given key is not already used, otherwise do nothing. Expiration time in seconds (0 second means eternity).
Note: When expiration is defined, it is not an atomic operation. Redis does not provide a command for store-if-not-exists with duration. First, it sets the value if exists. Then, if the operation succeeded, it sets its expiration date.
Note: When recovery policy used, it recovers with TRUE to indicate **"the lock was acquired"** despite actually **not storing** anything.
cache storage key
value to store
record duration in seconds
true if value was set, false if was ignored because it existed before
Asynchronous non-blocking implementation of the connection to the redis database