I am running a simple web application supported by node.js and I am trying to use redis to store some key-value pairs. All I do is run βnode index.jsβ on the command line, and here are the first few lines of my index.js:
var app = require('express').createServer(); var io = require('socket.io').listen(app); var redis = require('redis'); var redis_client = redis.createClient(); redis_client.set("hello", "world"); console.log(redis_client.get("hello"));
However, everything I get for redis_client.get("hello") instead of "world" is false . Why doesn't he return "world" ?
(And I start the redis server)
What is strange is that the example code shown here works fine and produces the expected result. Is there something I'm doing wrong for simple set and get ?
source share