@vartanovs/redis-client
v1.1.3
Published
Client to access redis data store
Downloads
1
Readme
Redis Client
This package contains a client to access a redis data store.
Installation
_$ npm install @vartanovs/redis-client
Basic Usage
import * as RedisClient from '@vartanovs/redis-client';
const redisOptions = {
host: process.env.REDIS_HOST,
port: Number(process.env.REDIS_PORT),
}
const redisClient = new RedisClient(redisOptions);
redisClient.init();
// Insert, find and delete documents from a collection
await redisClient.insertOne('animals', { name: 'anteater' });
await redisClient.insertMany('animals', [{ name: 'bear' }, { name: 'cat' }]);
const savedAnimals = await redisClient.findAll('animals');
await redisClient.deleteAll('animals');