9951 explained code solutions for 126 technologies


lua-redisGet list values


local redis = (require 'redis').connect('127.0.0.1', 6379)
local list = redis:lrange('list_key', 0, 10)ctrl + c
require 'redis'

load Redis module for Lua

connect

connect to Redis server

'127.0.0.1', 6379

Redis host and port to connect to

:lrange

gets values of specified list

list_key

key name of the Redis list to get

0, 10

return list items starting from first (0 index) and ending with 10th item