In Redis, the OBJECT ENCODING
command returns the internal encoding for the Redis object stored at the specified key.
Author: Ian
How to Increment a Floating Point Number in Redis
The INCR
command is commonly used in Redis to increment a value by one. And the INCRBY
command can be used to increment a valued by a specified integer. But neither of those commands let us work with floating point numbers.
If we want to use floating point numbers, we can use the INCRBYFLOAT
command.
Redis RANDOMKEY Command Explained
In Redis, the RANDOMKEY
command returns a random key from the currently selected database.
How to Set Multiple Strings in Redis
Redis provides us with a convenient way to set multiple strings at once. Specifically, the MSET
command enables us to set multiple strings in one go.
There’s also the MSETNX
command which does the same thing, but only if none of the keys already exist.
2 Ways to List All Tables in a PostgreSQL Database
Here are a couple of options for getting a list of tables in a database in PostgreSQL.
The first option is a psql
command, the second involves querying an information schema view.
Redis KEYS Command Explained
In Redis, the KEYS
command returns all keys in the database matching a given pattern.
Redis DUMP Command Explained
The Redis DUMP
command serialises the value stored at a specified key in a Redis-specific format and returns it to the user.
The serialisation format contains a 64-bit checksum that is used to make sure errors will be detected. The values are in the same format used by the RDB. Also, an RDB version is encoded inside the serialised value, so that different Redis versions with incompatible RDB formats will refuse to process the serialised value.
Continue readingRedis TOUCH Command Explained
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.
Continue reading