You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc states that Redis#{ttl,pttl} return -1 if the key does not
exist **or** if the key exists but has no associated expire.
This is incorrect with respect to the Redis' doc [here](http://redis.io/commands/ttl)
The documentation is also incorrent with respect to the current library behavior:
```
irb(main):059:0* conn = Redis.new
=> #<Redis client v3.1.0 for redis://127.0.0.1:6379/0>
irb(main):060:0> conn.ttl 'asdf'
=> -2
irb(main):065:0> conn.set 'asdf', 123
=> "OK"
irb(main):070:0> conn.ttl 'asdf'
=> -1
irb(main):071:0> conn.expire 'asdf', 100
=> true
irb(main):082:0> conn.ttl 'asdf'
=> 99
irb(main):059:0* conn = Redis.new
=> #<Redis client v3.1.0 for redis://127.0.0.1:6379/0>
irb(main):085:0> conn.pttl 'jkl;'
=> -2
irb(main):086:0> conn.set 'jkl;', 123
=> "OK"
irb(main):089:0> conn.pttl 'jkl;'
=> -1
irb(main):090:0> conn.expire 'jkl;', 100
=> true
irb(main):093:0> conn.pttl 'jkl;'
=> 91225
irb(main):097:0>
```
This commit adds the mention to a `-2` return value.
0 commit comments