Redis.setnx

SETNX works exactly like {@link #set(string, string) SET} with the only difference that if the key already exists no operation is performed. SETNX actually means "SET if Not eXists". <p> Time complexity: O(1) @param key @param value @return Integer reply, specifically: 1 if the key was set 0 if the key was not set

  1. Long setnx(string key, string value)
    class Redis
    Long
    setnx
    (
    string key
    ,
    string value
    )
  2. alias setnx = BinaryRedis.setnx

Meta