Basic grammar
TTL key
TTL命令用来查询一个键还有多久的时间会被删除。
The key has an expiration time set, and then the key is deleted or expired, use the return value of the TTL command
Operation example:
The key does not set the expiration time, use the return value of the TTL command
Operation example:
If the key has an expiration time set, when the key expires or is deleted, the TTL command returns -2. When the key does not set an expiration time, it means it is permanent, and the TTL command returns -1.