Method: Redis::Commands::Strings#strlen

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

#strlen(key) ⇒ Integer

Get the length of the value stored in a key.

Parameters:

  • key (String)

Returns:

  • (Integer)

    the length of the value stored in the key, or 0 if the key does not exist



309
310
311
# File 'lib/redis/commands/strings.rb', line 309

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