Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Task Management System | Data Types in Redis
Introduction to Redis

bookChallenge: Task Management System

Imagine you have a simple task management system using a list in Redis. Your task is to perform the following actions:

  1. Create a task list (named todo_list) and add the following tasks to it: "Do a workout", "Read a book", "Call a friend";

  2. Retrieve and display the entire task list. After this step, the list should contain three tasks;

  3. Remove the last task from the list and display the updated list. After this step, the list should contain only two tasks;

  4. Update the first task to "Cook lunch" and display the updated list. After this step, the list should reflect the change;

  5. Retrieve the text of the second task directly (by index). Redis should return the task's text.

Creating a task list and adding tasks:

Retrieving the entire task list:

Removing the last task and displaying the list:

The RPOP command removes the last item in the list "Do a workout".

Then, use LRANGE again to check the updated list:

Updating the first task and displaying the list:

The LSET command updates the item at the specified index. Here, "Cook lunch" replaces "Call a friend" (index 0).

Use LRANGE again to verify the update:

Retrieving the second task directly by index:

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 3

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Awesome!

Completion rate improved to 3.33

bookChallenge: Task Management System

Свайпніть щоб показати меню

Imagine you have a simple task management system using a list in Redis. Your task is to perform the following actions:

  1. Create a task list (named todo_list) and add the following tasks to it: "Do a workout", "Read a book", "Call a friend";

  2. Retrieve and display the entire task list. After this step, the list should contain three tasks;

  3. Remove the last task from the list and display the updated list. After this step, the list should contain only two tasks;

  4. Update the first task to "Cook lunch" and display the updated list. After this step, the list should reflect the change;

  5. Retrieve the text of the second task directly (by index). Redis should return the task's text.

Creating a task list and adding tasks:

Retrieving the entire task list:

Removing the last task and displaying the list:

The RPOP command removes the last item in the list "Do a workout".

Then, use LRANGE again to check the updated list:

Updating the first task and displaying the list:

The LSET command updates the item at the specified index. Here, "Cook lunch" replaces "Call a friend" (index 0).

Use LRANGE again to verify the update:

Retrieving the second task directly by index:

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 3. Розділ 3
some-alt