redis - Why is the nxxx parameter of set() in Jedis exclusive? -



redis - Why is the nxxx parameter of set() in Jedis exclusive? -

in jedis, want set key , value expiring time single invocation.

i can combination of set() , expire() needs 2 invocations.

i found next method:

set(final string key, final string value, final string nxxx, final string expx, final long time)

but have take nx (only set key if not exist.) or xx (only set key if exist.).

i want cover both cases.

any suggestion? or reason written this?

redis has setex command, sets key expiry.

jedis.setex(key, expireafter, value);

redis jedis

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -