I have stored some keys with a pattern like this: 'user:id'
The id is unique.
Now I'm going to get all keys started with 'user' and also get their values.
This is my code to get values but it gives me an empty list.
const { createClient } = require('redis');
async function redisCatch() {
const client = createClient();
client.on('error', (err) => console.log('Redis Client Error', err));
await client.connect();
const value = await client.sMembers('user:*');
console.log(value);
};
redisCatch();