Upstash Documentation

HPEXPIREAT

Sets an expiration time for field(s) in a hash in milliseconds since the Unix epoch.
1 min read

Arguments#

keystringrequired#

The key of the hash.

fieldsstring | number | (string | number)[]required#

The field(s) to set an expiration time for.

timestampnumberrequired#

The expiration time as a Unix timestamp in milliseconds.

optionstring#

Optional condition for setting the expiration:

  • NX: Set the expiration only if the field does not already have an expiration.
  • XX: Set the expiration only if the field already has an expiration.
  • GT: Set the expiration only if the new TTL is greater than the current TTL.
  • LT: Set the expiration only if the new TTL is less than the current TTL.

Response#