Skip to content

Home / node / Commands / type-aliases / HSetExExpiry @valkey/valkey-glide


@valkey/valkey-glide / Commands / HSetExExpiry

Type Alias: HSetExExpiry

HSetExExpiry = { count: number; type: TimeUnit; } | "KEEPTTL"

Expiry options specifically for HSETEX command. Supports standard expiry options (EX/PX/EXAT/PXAT) and KEEPTTL, but excludes PERSIST.

Example

// Set expiration to 60 seconds
const expiry: HSetExExpiry = { type: TimeUnit.Seconds, count: 60 };

// Keep existing TTL
const keepTtl: HSetExExpiry = "KEEPTTL";