Permalink
Browse files

Add subqueries example.

  • Loading branch information...
1 parent 81fc851 commit 95e60006f699d69150858737a0b3db91793222f9 @mranney mranney committed Nov 3, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 examples/subqueries.js
View
@@ -0,0 +1,15 @@
+// Sending commands in response to other commands.
+// This example runs "type" against every key in the database
+//
+var client = require("redis").createClient();
+
+client.keys("*", function (err, keys) {
+ keys.forEach(function (key, pos) {
+ client.type(key, function (err, keytype) {
+ console.log(key + " is " + keytype);
+ if (pos === (keys.length - 1)) {
+ client.quit();
+ }
+ });
+ });
+});

0 comments on commit 95e6000

Please sign in to comment.