Sha256: 761bfac5762c766620659a1344ebd0f14de207b7c3e8d2b3455178bf18544dde
Contents?: true
Size: 541 Bytes
Versions: 33
Compression:
Stored size: 541 Bytes
Contents
var client = require("redis").createClient(); function print_results(obj) { console.dir(obj); } // 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 print_results(key_types); } }); }); });
Version data entries
33 entries across 33 versions & 4 rubygems