Redis: How to use Redis Hashes

So far with Lists and Sets we saw how to correlate a key with a value, or a group of values.

Hashes let us associate more than one value to a single key, and they are perfect to store object-like items.

For example, a person has a name and an age.

We can create a person:1 hash:

HMSET person:1 name "Flavio" age 37

To get all the properties of a user, use HGETALL:

HGETALL person:1

You can update a hash property using HSET:

HSET person:1 age 38

You can increment a value stored in a hash using HINCRBY:

HINCRBY person:1 age 2

See all the hash commands here.

Lessons in this unit:

0: Introduction
1: Introduction to Redis
2: How to install Redis
3: First steps with Redis
4: Redis Lists
5: Using Redis Sets
6: How to use Redis Sorted Lists
7: ▶︎ How to use Redis Hashes
8: Redis Publish/subscribe
9: How to use Redis from Node.js

Join my AI Workshop!

The Web Development BOOTCAMP cohort starts in February 2026