The Redis TOUCH command alters the last access time of a key or keys. It allows us to alter the access time of a key without accessing it directly.
Subtract Hours from a Time Value in SQLite
In SQLite, we can use the TIME() function to subtract one or more hours from a time value.
For datetime values, we can use the DATETIME() function.
Redis EXISTS Command Explained
In Redis, the EXISTS command checks whether the specified keys exist. It returns an integer reply with the number of keys that exist.
We can use the command to check for the existence of one key or multiple keys.
Redis SORT_RO Command Explained
The Redis SORT_RO command is a read-only variant of the SORT command. It allows us to sort lists, sets, and sorted sets.
The SORT command enables us to have the sorted elements returned to the client, or stored in a separate key. But the SORT_RO command only allows us to have them returned to the client.
The SORT_RO variant was introduced in Redis 7.0.0 to enable SORT functionality in read-only replicas without breaking compatibility on command flags.
Redis SORT Command Explained
In Redis, the SORT command allows us to sort lists, sets, and sorted sets.
We can have the sorted elements returned to the client, or we can store them in a separate key.
3 Ways to Get the Start of the Month in MariaDB
Here are three options for returning the first day of a month in MariaDB.
This could be the first day of the current month, or the first day of the month based on a date that we specify.
Redis TYPE Command Explained
In Redis, the TYPE command returns a key’s type. More specifically, it returns the string representation of the type of the value stored at a given key.
Redis UNLINK Command Explained
In Redis, the UNLINK command removes the specified keys. It’s similar to the DEL command, except that it performs the memory reclaiming in a different thread, so it is not blocking. The DEL command, on the other hand, doesn’t do this.
More specifically, the UNLINK command unlinks the keys from the keyspace, and then removes it later asynchronously.
Redis RENAMENX Command Explained
In Redis, the RENAMENX command renames a key, but only if the new key doesn’t already exist.
RENAMENX is similar to the RENAME command, except that it only renames the key if the new one doesn’t already exist. The RENAME command on the other hand, will overwrite the new key if it already exists.
How to Run the Same Command Multiple Times in Redis
The Redis CLI allows us to easily run a command multiple times. All we need to do is prefix the command with the number of times we want it to run.