Using redis and node.js issue: why does redis.get return false? -



Using redis and node.js issue: why does redis.get return false? -

i'm running simple web app backed node.js, , i'm trying utilize redis store key-value pairs. run "node index.js" on command line, , here's first few lines of 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, redis_client.get("hello") instead of "world" false. why not returning "world"?

(and running redis-server)

what's weird illustration code posted here runs fine, , produces expected output. there i'm doing incorrectly simple set , get?

i bet asynchronous, value callback.

edit: it's asynchronous: file.js

node.js redis

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -