redis-mock icon indicating copy to clipboard operation
redis-mock copied to clipboard

Add support for redis.multi();

Open matmar10 opened this issue 9 years ago • 0 comments

Steps to reproduce

var redis = require('redis-mock');
var redisClient = redis.createClient();

// from the redis docs at
client.multi()
    .scard("bigset")
    .smembers("bigset")
    .keys("*", function (err, replies) {
        // NOTE: code in this callback is NOT atomic
        // this only happens after the the .exec call finishes.
        client.mget(replies, redis.print);
    })
    .dbsize()
    .exec(function (err, replies) {
        console.log("MULTI got " + replies.length + " replies");
        replies.forEach(function (reply, index) {
            console.log("Reply " + index + ": " + reply.toString());
        });
    });

Actual behavior multi is not a function

Expected behavior Batch redis commands as specified in redis docs

matmar10 avatar May 19 '16 18:05 matmar10