Sets a timeout on key. The key will automatically be deleted.
await redis.set("mykey", "Hello"); const tenSecondsFromNow = Math.floor(Date.now() / 1000) + 10; await redis.expireat("mykey", tenSecondsFromNow);
The key to set the timeout on.
A unix timestamp in seconds at which point the key will expire.
1 if the timeout was set, 0 otherwise
1
0
Was this page helpful?