Node cannot get the value in redis? Ask for advice

  node.js, question

I use node to operate redis can be set, but always null when getting. I can get the value under redis-cli. Why is this? Does anyone know

Redis callback function parameter types are error-first, like this

redis.get('name',function(err,result){
 if(err){
 //do
 }else{
 console.log(err) //null
 console.log(result) //get answer
 bracket
 })

Are you missing a parameter, like this

redis.get('name',function(result){
 console.log(result)//null
 })