module Redis::Commands::Lists

def lmpop(*keys, modifier: "LEFT", count: nil)

Returns:
  • (Array>) - list of popped elements or nil

Other tags:
    Example: With count option -
    Example: Popping a element -
def lmpop(*keys, modifier: "LEFT", count: nil)
  raise ArgumentError, "Pick either LEFT or RIGHT" unless modifier == "LEFT" || modifier == "RIGHT"
  args = [:lmpop, keys.size, *keys, modifier]
  args << "COUNT" << Integer(count) if count
  send_command(args)
end