Redis RPUSHX Command Explained

In 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.

Read more

Redis RPUSH Command Explained

In 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.

Read more

Redis LPUSHX Command Explained

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.

Read more

Redis LPUSH Command Explained

In 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.

Read more

Redis SUBSTR Equivalent

Many SQL databases have a SUBSTR() or equivalent function that returns a substring from a specified string.

Redis has a SUBSTR command, but it was deprecated in Redis 2.0.0.

However, Redis also has the GETRANGE command, that basically does the same thing. Basically, anything that was possible with the Redis SUBSTR command, is now possible with the GETRANGE command.

And the GETRANGE command does basically the same thing that most of the SUBSTR() and SUBSTRING() functions do in the SQL world – gets a substring from a string.

Read more

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.

Read more