title: NodeJS+Redis HGETALL returns undefined
body: <p>seemed to me, I need some help
  I have NodeJS +  Redis and trying to get data from Redis with help of nodejs</p>
  
  <pre><code>var redis = require('redis'),client = redis.createClient();
  client.on("error", function (err) {
    console.log("Error: " + err);
  });
  client.keys("currency:*", function (err, keys) {
          keys.forEach(function (key, i) {
              console.log(key);
              client.hgetall(key, function (err, currencyData) {
                  console.log(currencyData);
              })
          });
  });
  client.quit();
  </code></pre>
  
  <p>first console.log returns the correct key pair
  the second console.log always return undefined even if I manually set the variable</p>
  
  <pre><code>...
  currency:13977251354940.4693533380050212
  currency:13977251347600.9115635070484132
  currency:13977251346660.3178929006680846
  currency:13977251355930.11270855111069977
  currency:13977251349960.9243609569966793
  currency:13977251353130.7620244727004319
  currency:13977251345050.8327386728487909
  currency:13977251355830.1213580728508532
  currency:13977251351530.48609258118085563
  currency:13977251349030.10637291427701712
  currency:13977251348590.6786048328503966
  ...
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  undefined
  ....
  </code></pre>
  
  <p>the query to the database returns the neessary object:</p>
  
  <pre><code>    127.0.0.1:6379&gt; hgetall "currency:13977251347740.9971425810363144"
   1) "date"
   2) "24/01/14"
   3) "time"
   4) "21:03:00"
   5) "high"
   6) "1.3678000"
   7) "low"
   8) "1.3673000"
   9) "close"
  10) "1.3677000"
  11) "open"
  12) "1.3676000"
  </code></pre>
  
  <p>But if we remove the external forEach and manually set the key variable, the code correctly works:</p>
  
  <pre><code>var redis = require('redis'),client = redis.createClient();
  client.on("error", function (err) {
    console.log("Error: " + err);
  });
  client.hgetall("currency:13977251348590.6786048328503966", function (err, currencyData) {
     console.dir(currencyData);
  })
  client.quit();
  </code></pre>
  
  <p>and returns </p>
  
  <pre><code>{ date: '30/01/14',
    time: '22:26:00',
    high: '1.3554000',
    low: '1.3552000',
    close: '1.3552000',
    open: '1.3553000' }
  </code></pre>
  
  <p>I've also tried to add callback</p>
  
  <pre><code>var redis = require('redis'),client = redis.createClient();
  client.on("error", function (err) {
    console.log("Error: " + err);
  });
  var myKeys = new Array();
  function getKeys(callback) {  
      client.keys("currency:*", function (err, keys) {
              keys.forEach(function (key, i) {
                  myKeys.push(key);
              });
          callback();
      });      
  }  
  getKeys(function() {  
      myKeys.forEach(function(key){
          client.hgetall(key, function (err, currencyData) {
              if(!(currencyData===undefined))
                      console.dir(currencyData);
          })
      }) 
  });  
  client.quit();
  </code></pre>
  
  <p>with no result</p>