lib/algorithms.js
function(err){
                client.del(recommendedZSet, function(err){
                  async.each(scoreMap,
                    function(scorePair, callback){
                      client.zadd(recommendedZSet, scorePair[0], scorePair[1], function(err){
                        callback();
                      });
                    },
                    // after all the additions have been made to the recommended set,
                    function(err){
                      client.del(tempAllLikedSet, function(err){
                        client.zcard(recommendedZSet, function(err, length){
                          client.zremrangebyrank(recommendedZSet, 0, length-config.numOfRecsStore-1, function(err){
                            cb();
                          });
                        });
                      });
                    }
                  );
                });
              }
function(err){
                client.del(recommendedZSet, function(err){
                  async.each(scoreMap,
                    function(scorePair, callback){
                      client.zadd(recommendedZSet, scorePair[0], scorePair[1], function(err){
                        callback();
                      });
                    },
                    // after all the additions have been made to the recommended set,
                    function(err){
                      client.del(tempAllLikedSet, function(err){
                        client.zcard(recommendedZSet, function(err, length){
                          client.zremrangebyrank(recommendedZSet, 0, length-config.numOfRecsStore-1, function(err){
                            cb();
                          });
                        });
                      });
                    }
                  );
                });
              }
function ( err ) { client . del ( recommendedZSet , function ( err ) { async . each ( scoreMap , function ( scorePair , callback ) { client . zadd ( recommendedZSet , scorePair [ 0 ] , scorePair [ 1 ] , function ( err ) { callback ( ) ; } ) ; } , // after all the additions have been made to the recommended set, function ( err ) { client . del ( tempAllLikedSet , function ( err ) { client . zcard ( recommendedZSet , function ( err , length ) { client . zremrangebyrank ( recommendedZSet , 0 , length - config . numOfRecsStore - 1 , function ( err ) { cb ( ) ; } ) ; } ) ; } ) ; } ) ; } ) ; }
using score map which is an array of what the current user would rate all the unrated items, add them to that users sorted recommended set
using score map which is an array of what the current user would rate all the unrated items add them to that users sorted recommended set