The Redis HGETALL
command returns all fields and values from the hash at the specified key.
Category: DBMS
Database Management Systems
Redis HMGET Command
The Redis HMGET
command allows us to get multiple values from a hash. It returns the value/s associated with the specified field/s in the hash at the specified key.
Redis HGET Command
The Redis HGET
command allows us to get a value from a hash. It returns the value associated with the specified field in the hash at the specified key.
3 Ways to Check if a Table has a Generated Column in SQLite
If you’re not sure if a table has a generated column in SQLite, you can quickly find out with either the .schema
command, or by querying the sqlite_schema
table.
Redis HRANDFIELD Command
The Redis HRANDFIELD
command allows us to get a random field from a given key.
The command accepts several arguments that allows us to specify the number of random fields returned, whether to include the same field multiple times, and whether or not to include the values with each field returned.
The HRANDFIELD
command was introduced in Redis 6.2.0.
Redis HEXISTS Command
In Redis, the HEXISTS
command allows us to check whether a field exists in a given hash. We pass the name of the key and the field to the command, and it returns 1
if the field exists, and 0
if it doesn’t.
Fix “ERR numkeys should be greater than 0” when using the SINTERCARD Command in Redis
If you’re getting an error that reads “ERR numkeys should be greater than 0” in Redis, it’s probably because you’re specifying a wrong value for the first argument when calling the SINTERCARD
command.
To fix this issue, make sure you’re passing a valid non-zero value that matches the number of keys you’re comparing.
Continue readingRedis HKEYS Command
The Redis HKEYS
command returns all fields in the hash stored at the specified key.
Redis HDEL Command
In Redis, the HDEL
command enables us to delete one or more fields in a hash. It deletes the specified field/s at the specified key.
If the field doesn’t exist, it’s ignored. If the key doesn’t exist, it’s treated as an empty hash and 0
is returned.
Redis HSETNX Command
In Redis, the HSETNX
command enables us to set a field in a hash, but only if the field doesn’t already exist. It sets the field at the specified key to the value we provide.
If the key doesn’t exist, it’s created with the specified hash value. If the field already exists, nothing is set (i.e. the command has no effect).
Continue reading