using redis

This is a complete Redis client for node.js. It supports all Redis commands, including

MULTI, WATCH, and PUBLISH/SUBSCRIBE.

For portability, a pure JavaScript reply parser is used by default. Pieter Noordhuis has provided a binding to the official hiredis C library, which is non-blocking and fast. To use hiredis, do:

npm install hiredis redis 

REDIS : Remote dictionary server.

Nice tutorial

http://simonwillison.net/static/2010/redis-tutorial/

the main site : you can see commands in documentation .

http://redis.io/

to install redis : and running server

http://camp.nodejs.org/

 
var redis = require("redis"),
    client = redis.createClient();

    client.set("foo_rand000000000000", "some fantastic value");
    client.get("foo_rand000000000000", function (err, reply) {
        console.log(reply.toString());
    });
    client.set(["some key", "some val"]);
    client.set(["some other key", "some val"]);
    client.get("some key", function (err, reply) {
        console.log(reply.toString());
    });
  client.hmset("hosts", "mjr", "1", "another", "23", "home", "1234");
  client.hgetall("hosts", function (err, obj) {
      console.dir(obj);
  });
client.mset(["test keys 1", "test val 1", "test keys 2", "test val 2"], function (err, res) {
 console.dir(res);

});

How to run redis command line

SRC> ./redis-cli

to run server

src> ./redis-server

Ref : http://redis.io/download

 

Ref :

https://github.com/mranney/node_redis

Advertisements

About rahul23134654

Hi, I am Rahul Meha , B.E. in (I.T.)
This entry was posted in Node.js. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s