I have redis
client and mongodb
, I want to speed up my database, for doing this I am fetching the users details from redis
cache and want to save it into mongodb
using node.js
.
Your answers will be very helpful for me.
client.smembers('login',function(err,obj){
if(obj.length === 0)
callback(obj);
obj.forEachDone(function(reply,done){
console.log(reply);
client.hgetall(reply,function(err,value){
value.login_value = decodeURI(value.login_value);
done(value);
});
},this,function(objArr){
objArr.sort(utils.compare);
console.log(objArr);
});
});