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

Delphi change the assembly code of a running process -

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

C++ 11 "class" keyword -