node.js - Redis SET Command in Express.js -


probably silly question can see redis docs set key hold string value use:

set mykey "hello" 

but docs seem focused on commands command line.

i using express.js (with node.js) , want able run commands server.js file.

at moment have:

# db redis.createclient object set earlier in code db.set(mykey "hello"); 

but doesn't work - syntax error warning.

any advice?

you're missing comma in function call. redis uses spaces separate arguments, node.js uses commas. code should like:

db.set(mykey, "hello") 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -