File: connected-users-websocket/node_modules/socket.io/node_modules/redis/examples/subquery.js

Recommend this page to a friend!
  Classes of Igor Escobar   Terminal Crossword   connected-users-websocket/node_modules/socket.io/node_modules/redis/examples/subquery.js   Download  
File: connected-users-websocket/node_modules/socket.io/node_modules/redis/examples/subquery.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Terminal Crossword
Generate a crosswords board on a text console
Author: By
Last change:
Date: 2 years ago
Size: 541 bytes
 

Contents

Class file image Download
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); } }); }); });