1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-01 16:46:54 +03:00
Files
node-redis/examples/subquery.js
Ruben Bridgewater 7922d4eb85 Small style changes
2015-10-07 16:34:41 +02:00

18 lines
495 B
JavaScript

'use strict';
var client = require('redis').createClient();
// build a map of all keys and their types
client.keys('*', function (err, all_keys) {
var key_types = {};
all_keys.forEach(function (key, pos) { // use second arg of forEach to get pos
client.type(key, function (err, type) {
key_types[key] = type;
if (pos === all_keys.length - 1) { // callbacks all run in order
console.dir(key_types);
}
});
});
});