aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/redis/examples/subqueries.js
blob: 560db2404e1c90a19a9ce4726f34511c95ae41c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Sending commands in response to other commands.
// This example runs "type" against every key in the database
//
var client = require("redis").createClient();

client.keys("*", function (err, keys) {
    keys.forEach(function (key, pos) {
        client.type(key, function (err, keytype) {
            console.log(key + " is " + keytype);
            if (pos === (keys.length - 1)) {
                client.quit();
            }
        });
    });
});