Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende SET Command | The Essential Redis Commands
Introduction to Redis
course content

Contenido del Curso

Introduction to Redis

Introduction to Redis

1. Redis Fundamentals
2. The Essential Redis Commands
3. Data Types in Redis
4. Advanced Features and Security
5. Caching with Redis and Spring Boot

book
SET Command

Let's move on to learning the basic Redis commands. To use them, open the Redis CLI using the command: redis-cli, making sure that the Redis server is running first.

SET Command

The SET command is used to store a key-value pair in Redis. If the key already exists, its value will be overwritten with the new one.

A key is a unique name under which a value will be stored in Redis. The value represents the data you want to save, and it can be a string, number, JSON, or another data format.

Example Usage

Suppose we want to create a key named mykey and store a specific value in it. Using the syntax above, we can execute:

As a result, Redis creates a record where the key is mykey and the value is the string Hello, Redis!. If the key mykey already existed, its previous value would be replaced with the new one.

1. What does the SET command do in Redis?

2. What is the syntax for using the SET command in Redis?

What does the SET command do in Redis?

What does the SET command do in Redis?

Selecciona la respuesta correcta

What is the syntax for using the `SET` command in Redis?

What is the syntax for using the SET command in Redis?

Selecciona la respuesta correcta

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 1
We're sorry to hear that something went wrong. What happened?
some-alt