---
--- 从list中头部获取指定数量的数据，然后删除
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Administrator.
--- DateTime: 2018-12-19 15:21
---

local key = KEYS[1]
local range = tonumber(ARGV[1]) - 1

local result = redis.call('LRANGE', key, 0, range)
redis.call('LTRIM', key, range + 1, -1)
return result