node-redis-multi
A Node.js library to augment node_redis with an enhanced version of MULTI command.
Installation
npm install node-redis-multi --save
Usage
node-redis-multi
replaces methods that are related to MULTI
.
The callback of .exec()
will get invoked with two arguments as the original version but second argument is a Response
object.
// module depsvar redis = ; redis; var client = redis multi = client; multi ;
Response
Response object lets you query replies from .exec()
using two different methods: Response#get(<key>)
and Response#at(<index>)
.
Response#get(<key>)
lets you retrieve a reply by key:
multi ;
Response#get(<key>)
is applicable only if the issued command has
- arity > 0;
readonly
flag;- position of first key === 1;
- position of last key === 1.
See Redis COMMAND for further information.
Response#at(<index>)
lets you retrieve a reply by its index:
multi ;