Method: Redis#linsert

Defined in:
lib/redis.rb

#linsert(key, where, pivot, value) ⇒ Fixnum

Insert an element before or after another element in a list.

Parameters:

  • key (String)
  • where (String, Symbol)

    BEFORE or AFTER

  • pivot (String)

    reference element

  • value (String)

Returns:

  • (Fixnum)

    length of the list after the insert operation, or -1 when the element pivot was not found



1150
1151
1152
1153
1154
# File 'lib/redis.rb', line 1150

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