API ReferenceUtilities
Overview
Utility operations provide system-level functionality for Redis management, health monitoring, custom command execution, and direct access to the Redis instance. These operations are useful for administration, debugging, and advanced use cases.
Available Operations
Connection
Information
- Info - Get server information and statistics
Database
- FlushDB - Delete all keys in current database
Advanced
- Execute - Execute raw Redis command
- GetInstance - Get direct access to Redis instance
Use Cases
- Health monitoring
- Statistics collection
- Custom commands execution
- Development and debugging
- Administration tasks
Quick Example
local Redix = exports.redix:GetInterface()
-- Health check
Redix.Ping(function(err, response)
if response == 'PONG' then
print('Redis is healthy')
end
end)
-- Get server info
Redix.Info('stats', function(err, stats)
print('Redis stats:', stats)
end)Some operations like FlushDB are destructive. Use with caution, especially in production.