Method: Redis#lpush

Defined in:
lib/redis.rb

#lpush(key, value) ⇒ Fixnum

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

Parameters:

  • key (String)
  • string (String, Array)

    value, or array of string values to push

Returns:

  • (Fixnum)

    the length of the list after the push operation



968
969
970
971
972
# File 'lib/redis.rb', line 968

def lpush(key, value)
  synchronize do |client|
    client.call([:lpush, key, value])
  end
end