redis-pdel

4.0.1 • Public • Published

redis-pdel

Build Status npm package

pdel lua command for redis clients

pdel redis command

Deletes all the keys matching a specific regex, for example

set foo:one val
set foo:two val
pdel foo:*
get foo:one <- nil
get foo:two <- nil

Note: this is not meant to be used in production. Supports Node 4+.

Install

$ npm install --save redis-pdel

Usage

The easiest usecase is to use with https://github.com/luin/ioredis as follows:

import Redis from 'ioredis';
import { name, lua, numberOfKeys } from 'redis-pdel';

const redis = new Redis();
redis.defineCommand(name, { lua, numberOfKeys });

Then, just run like any other command:

redis.pdel('foo:*');

Tests

There are unit tests and integration tests. The integration tests require redis to be running.

docker-compose up
npm test:unit
npm test:integration
npm test # run both tests

License

See the LICENSE file for license rights and limitations (MIT).

Readme

Keywords

Package Sidebar

Install

npm i redis-pdel

Weekly Downloads

16

Version

4.0.1

License

MIT

Unpacked Size

4.51 kB

Total Files

4

Last publish

Collaborators

  • perrin4869
  • 20lives