title: how to save data by loop in redis
body: <p>using this redis node client 
  <a href="https://github.com/mranney/node_redis" rel="nofollow">https://github.com/mranney/node_redis</a></p>
  
  <p>i want to save the three uses simultaneously in loop . 
  but not able to save only last users is getting saved ? 
  here i want to save rahul0,rahul1, rahul2 to be as users in redis 
  but only rahul2 is getting saved.</p>
  
  <pre class="lang-js prettyprint-override"><code>var redis = require("redis"),
      sys = require("sys"),
      client = redis.createClient();
  
  client.del("channels.59-O");
  
  for(var j=0; j&lt;3; j++) {
      client.hgetall("channels.59-O", makeCallback(j));
      function makeCallback(index) {
          return function(err, result){
              console.log('check '+sys.inspect(result));
              if(!result.users) {
                  var channeldata={
                      'users':"rahul"+index
                  };
                  console.log('dsfsdc'+sys.inspect(channeldata));
                  client.hmset('channels.59-O', channeldata);
              } else {
                  var users=result.users.split(',');
                  users.push("rahul"+index);
                  var channeldata={
                      'users':users.join(',')
                  };
                  console.log('check 1 '+sys.inspect(channeldata));
                  client.hmset('channels.59-O', channeldata);
              }
          };
      }
  }
  </code></pre>
  
  <p>Please suggest what to do?</p>