As of Redis version 2.6.12, this command is regarded as deprecated. It can be replaced by SET with the NX argument when migrating or writing new code. SETNX key value Available since: Redis Open Source 1.0.0 Time complexity: O(1) ACL categories: @write, @string, @fast, Set key to hold string value if key does not exist. In that case, it is equal to SET. When key already holds a value, no operation