From b60df56157ee1fd0bd4938799bac05a62fda91a1 Mon Sep 17 00:00:00 2001 From: lookshe Date: Sat, 14 Mar 2015 20:45:20 +0100 Subject: initial commit from working version --- .../socket.io/node_modules/redis/examples/subquery.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 signaling-server/node_modules/socket.io/node_modules/redis/examples/subquery.js (limited to 'signaling-server/node_modules/socket.io/node_modules/redis/examples/subquery.js') diff --git a/signaling-server/node_modules/socket.io/node_modules/redis/examples/subquery.js b/signaling-server/node_modules/socket.io/node_modules/redis/examples/subquery.js new file mode 100644 index 0000000..861657e --- /dev/null +++ b/signaling-server/node_modules/socket.io/node_modules/redis/examples/subquery.js @@ -0,0 +1,19 @@ +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); + } + }); + }); +}); -- cgit v1.2.3