Practice: What is Redis? · Redis

Ch 2 · Redis Introduction and Setup — card 3 of 4.

Time to try the basics yourself. You will connect to Redis, store a value under a key, read it back and print it, then save a second key that expires and check how long it has left. A correct answer proves you understand the difference between a permanent key and one with a time-to-live, and what TTL tells you about each.

  1. Connect to Redis
  2. SET a key with a value
  3. GET the value and log it
  4. SET with expiration and check TTL
const Redis = require("ioredis");
const redis = new Redis();

// Set a key
// Get and log it
// Set with TTL
// Check TTL