Method: Redis::Commands::Strings#setnx
- Defined in:
- lib/redis/commands/strings.rb
#setnx(key, value) ⇒ Boolean
Set the value of a key, only if the key does not exist.
126 127 128 |
# File 'lib/redis/commands/strings.rb', line 126 def setnx(key, value) send_command([:setnx, key, value.to_s], &Boolify) end |