Complete the code to create a new Redis client using ioredis.
const Redis = require('ioredis'); const redis = new [1]();
The Redis class from the ioredis package is used to create a new Redis client instance.
Complete the code to set a key 'name' with value 'Alice' in Redis.
await redis.[1]('name', 'Alice');
The set command stores a key-value pair in Redis.
Fix the error in the code to get the value of key 'name' from Redis.
const value = await redis.[1]('name');
The get command retrieves the value stored at the given key.
Fill both blanks to delete the key 'name' and check if it still exists.
await redis.[1]('name'); const exists = await redis.[2]('name');
The del command deletes a key, and exists checks if the key is still present.
Fill all three blanks to increment a counter, get its value, and then reset it to zero.
await redis.[1]('counter'); const count = await redis.[2]('counter'); await redis.[3]('counter', 0);
incr increases the counter by 1, get retrieves its value, and set resets it to zero.
