SETNX
Since 1.1.0Strings
Syntax
SETNX key valueSets key to value only if the key does not exist. It is SET key value NX with an integer reply.
Reply
1if the key was set.0if the key already existed, and nothing changed.
Examples
> SETNX lock owner-1
(integer) 1
> SETNX lock owner-2
(integer) 0