In SQLite, we can use the TIME()
function to add a given number of minutes to a time value.
If we’re dealing with datetime values, we can use the DATETIME()
function.
In SQLite, we can use the TIME()
function to add a given number of minutes to a time value.
If we’re dealing with datetime values, we can use the DATETIME()
function.
If you’re getting an error that reads “ERR wrong number of arguments for ‘smembers’ command” in Redis, it’s because you’re calling the SMEMBERS
command with the wrong number of arguments.
To fix this issue, make sure you’re passing the correct number of arguments. At the time of writing, the correct number of arguments for this command is one.
Continue readingIf you need to rename a key in Redis, you may be wondering how to do it without overwriting any existing keys. If you use the RENAME
command, and a key already exists with your new key name, you’ll overwrite the existing key.
Fortunately, Redis also has a RENAMENX
command, which only renames the key if there’s no other key with the new name. So we can use this command whenever we need to rename a key without fear of overwriting any existing keys.
I thought I’d compile a list of Redis commands that can be used to set strings. Each command has its own specific use, and so the command used will depend on the situation.
In any case, here are 14 commands that set strings in Redis.
Continue readingIf you have a table in MariaDB with a generated column, you can use the following methods to find out its definition.
Continue readingI decided to compile a list of commands that can be used to get the string value from a key in Redis. These are all string commands – commands that can be used when working with strings. In other words, the assumption is that the key holds a string value.
Continue readingIf you’re getting an error that reads “WRONGTYPE Operation against a key holding the wrong kind of value” when calling either the SUNION
command or the SUNIONSTORE
command in Redis, it’s probably because you’re passing a key with the wrong data type.
To fix this issue, make sure that each key that you pass holds a set.
Continue readingWhen working with Redis, we have multiple ways to return the members of a set. Here are 3 ways to return the members of a set in Redis.
Continue readingIf you know the name of a key in Redis, but you want to find out it’s type (eg, string, list, hash, set, etc), look no further than the TYPE
command. This command returns the string representation of the type of the value at the given key.
If you ever find yourself in the situation where you need to get a random key when using Redis, take a look at the RANDOMKEY
command.
This command returns a random key from the currently selected database.
Continue reading