9951 explained code solutions for 126 technologies


lua-redisGet hash value using hget


local redis = (require 'redis').connect('127.0.0.1', 6379)
redis:hget('hash_test', 'a')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

hash_test

hash name

'a'

key name

hget

returns specified key value for a given hash