9951 explained code solutions for 126 technologies


lua-redisGet all list values


local redis = (require 'redis').connect('127.0.0.1', 6379)
local list = redis:lrange('list_key', 0, -1)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, -1

returns all list values