Method: Redis::Commands::Lists#lpush

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

#lpush(key, value) ⇒ Integer

Prepend one or more values to a list, creating the list if it doesn't exist

Parameters:

  • key (String)
  • value (String, Array<String>)

    string value, or array of string values to push

Returns:

  • (Integer)

    the length of the list after the push operation


67
68
69
# File 'lib/redis/commands/lists.rb', line 67

def lpush(key, value)
  send_command([:lpush, key, value])
end