v0.7.0

TTL, EXPIRE, EXPIREAT, and PERSIST

Last updated


This page covers the ToriiDB commands that read, set, and remove a key's expiry.

Expiration


  1. TTL <key>
  2. EXPIRE <key> <seconds>
  3. EXPIREAT <key> <timestamp>
  4. PERSIST <key>

CommandResponse rules
TTL(integer) -1 without expiry; (nil) when missing or expired
EXPIREerror: seconds must be a positive integer for <= 0 or non-integer; (nil) when missing
EXPIREATerror: timestamp must be a valid integer; (nil) when missing
PERSIST(nil) when missing


中文