1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| import { createClient } from 'redis';
const client = await createClient() .on('error', err => console.log('Redis Client Error', err)) .connect();
await client.HSET('key', 'field', 'value'); await client.HGETALL('key');
await client.hSet('key', 'field', 'value'); await client.hGetAll('key');
await client.sendCommand(['HGETALL', 'key']);
|