Arguments
string
required
The key to set the timeout on.
integer
A unix timestamp in seconds at which point the key will expire.
Response
1 if the timeout was set, 0 otherwiseDocumentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
await redis.set("mykey", "Hello");
const tenSecondsFromNow = Math.floor(Date.now() / 1000) + 10;
await redis.expireat("mykey", tenSecondsFromNow);
Sets a timeout on key. The key will automatically be deleted.
1 if the timeout was set, 0 otherwiseawait redis.set("mykey", "Hello");
const tenSecondsFromNow = Math.floor(Date.now() / 1000) + 10;
await redis.expireat("mykey", tenSecondsFromNow);
Was this page helpful?