redis client setex nodejs code example
Example 1: redis set expire time node js
client.set(key, value, 'EX', 60 * 60 * 24, callback);
Example 2: nodejs redis setex
async function upsert(table, data) {
let key = table;
if (data && data.id) {
key = key + '_' + data.id;
}
client.setex(key, 10, JSON.stringify(data));
return true;
}