wan zong
wan zong

Reputation: 59

can not set expire time with `SET` in redis

\# redis-server -v
Redis server v=3.0.5 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=efd64775fb9b8d51
\# redis-cli -v
redis-cli 3.0.5

\# redis-cli
127.0.0.1:6379> set foo 10 10
(error) ERR syntax error

http://redis.io/commands/set

SET key value [EX seconds] [PX milliseconds] [NX|XX] Starting with
Redis 2.6.12 SET supports a set of options that modify its behavior:

why ?

Upvotes: 2

Views: 2276

Answers (1)

wan zong
wan zong

Reputation: 59

# redis-cli
127.0.0.1:6379> set foo 10 ex 10
OK

very impressed

Upvotes: 3

Related Questions