Method: Redis::Commands::Strings#getdel

Defined in:
lib/redis/commands/strings.rb

#getdel(key) ⇒ String

Get the value of key and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success.

Parameters:

  • key (String)

Returns:

  • (String)

    the old value stored in the key, or nil if the key did not exist

[View source] [View on GitHub]

275
276
277
# File 'lib/redis/commands/strings.rb', line 275

def getdel(key)
  send_command([:getdel, key])
end