Attempting to utilize the @upstash/redis node client library for Node.js (available at https://www.npmjs.com/package/@upstash/redis), I am facing challenges in executing the scan command, which should be supported based on the documentation. Specifically, I am having trouble setting the options:
const redis = new Redis({
url: process.env.UPSTASH_REDIS_REST_URL,
token: process.env.UPSTASH_REDIS_RO_REST_TOKEN,
});
const result = await redis.scan(0);
I have tried different approaches to include MATCH or COUNT (which are specified as ScanCommandOptions type) but have not been successful in obtaining results:
const result = await redis.scan(0, MATCH, 'title*');
const result = await redis.scan(0, (MATCH, 'title*'));
const result = await redis.scan(0, {MATCH:'title*'});
It seems that my attempts were incorrect. Can anyone provide guidance or an example of how to properly include these options?
Thank you.