I have just discovered how cool node js is and was looking at options for persisting. I saw that you could use redis-client to store data in redis and I have been able to store data ok, like so:
var redis = require('redis-client');
var r = redis.createClient();
var messege = {'name' => 'John Smith'};
var type = "Contact";
r.stream.on( 'connect', function() {
r.incr( 'id' , function( err, id ) {
r.set( type+':'+id, JSON.stringify(messege), function() {
sys.puts("Saved to redis");
});
});
});
This store a key with a json string as the value. I am however trying to retrieve all the keys from redis and loop around them. I am having trouble figuring out the way to do this, could anyone point me in the right direction?
Cheers
Eef