subqueries.js 456 B

123456789101112131415
  1. // Sending commands in response to other commands.
  2. // This example runs "type" against every key in the database
  3. //
  4. var client = require("redis").createClient();
  5. client.keys("*", function (err, keys) {
  6. keys.forEach(function (key, pos) {
  7. client.type(key, function (err, keytype) {
  8. console.log(key + " is " + keytype);
  9. if (pos === (keys.length - 1)) {
  10. client.quit();
  11. }
  12. });
  13. });
  14. });