index.js
function _getByIndex(indexName, indexData, callback) {
    // generate the index
    var index = indexName + '-' +
      crypto.createHash('sha256').update(indexData).digest('hex');

    // fetch the value of the index
    client.get(index, function(err, reply) {
      if(err) {
        return callback(err);
      }
      if(!reply) {
        // index does not exist
        return callback(null, null);
      }

      // fetch the actual data
      client.get(reply, _deserializeJson(callback));
    });
  }
function _getByIndex(indexName, indexData, callback) {
    // generate the index
    var index = indexName + '-' +
      crypto.createHash('sha256').update(indexData).digest('hex');

    // fetch the value of the index
    client.get(index, function(err, reply) {
      if(err) {
        return callback(err);
      }
      if(!reply) {
        // index does not exist
        return callback(null, null);
      }

      // fetch the actual data
      client.get(reply, _deserializeJson(callback));
    });
  }
function _getByIndex ( indexName , indexData , callback ) { // generate the index var index = indexName + '-' + crypto . createHash ( 'sha256' ) . update ( indexData ) . digest ( 'hex' ) ; // fetch the value of the index client . get ( index , function ( err , reply ) { if ( err ) { return callback ( err ) ; } if ( ! reply ) { // index does not exist return callback ( null , null ) ; } // fetch the actual data client . get ( reply , _deserializeJson ( callback ) ) ; } ) ; }
utility function to get a Redis-based value based on an index
utility function to get a Redis - based value based on an index