When using Redis, we often have many ways to do the same thing. One example of this is with deleting keys.
Below are four options for deleting keys in Redis.
Continue readingWhen using Redis, we often have many ways to do the same thing. One example of this is with deleting keys.
Below are four options for deleting keys in Redis.
Continue readingIn Redis, the RPUSHX
command inserts one or more values into the tail of the list at the specified key, but only if the key exists and it contains a list.
If the key doesn’t exist, no operation is performed. If the key exists but it doesn’t contain a list, an error is returned.
Continue readingIn Redis, the RPUSH
command inserts one or more values into the tail of the list at the specified key.
If the key doesn’t exist, it is created as an empty list before performing the push operation. If the key already holds a value that is not a list, an error is returned.
Continue readingIn SQLite, we can use the TIME()
function to subtract one or more seconds from a time value.
For datetime values, we can use the DATETIME()
function.
In Redis, the LPUSHX
command inserts one or more values into the head of the list at the specified key, but only if the key exists and it contains a list.
If the key doesn’t exist, no operation is performed. If the key exists but it doesn’t contain a list, an error is returned.
Continue readingIn Redis, the LPUSH
command inserts one or more values into the head of the list at the specified key.
If the key doesn’t exist, it is created as an empty list before performing the push operation. If the key already holds a value that is not a list, an error is returned.
Continue readingIn Redis, we can use the STRLEN
command to get the length of a given string value, based on its key.
We can also use the HSTRLEN
command to get the string length of a value stored in a hash.
Redis provides us with quite a few options for setting keys and any timeouts associated with those keys. Sometimes we can do it with a single command, other times we need two commands.
Here are four ways to set a key and its expiry in Redis.
Continue readingThe following examples use SQL to delete duplicate rows that have a primary key or unique identifier column.
Specifically, the examples delete all duplicates except one. So for example, in the case of three identical rows, it deletes two of them and keeps one.
Continue readingIf we need to append a value to a string in Redis, we can use the APPEND
command to do just that. All we need to do is call the command with the key name and the value to append.