Msetex
Bun

method

RedisClient.setex

key: KeyLike,
seconds: number,
value: KeyLike
): Promise<'OK'>;

Set key to hold the string value with expiration time in seconds

@param key

The key to set

@param seconds

The expiration time in seconds

@param value

The value to set

@returns

Promise that resolves with "OK" on success

await redis.setex("mykey", 10, "Hello");
// Key will expire after 10 seconds

Referenced types

type KeyLike = string | ArrayBufferView | Blob