3000 explained code solutions for 75 technologies


lua-redisHow to select db


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

:select

selects specified DB by number

(2)

select DB number 2