Skip to content

Instantly share code, notes, and snippets.

@horatio-sans-serif
Created May 7, 2010 14:59
Show Gist options
  • Save horatio-sans-serif/393517 to your computer and use it in GitHub Desktop.
Save horatio-sans-serif/393517 to your computer and use it in GitHub Desktop.
~/projects/redis-node-client(master) ⚡ redis-cli set test:c a
OK
~/projects/redis-node-client(master) ⚡ redis-cli set 'test: d' b
OK
~/projects/redis-node-client(master) ⚡ redis-cli keys '*'
1. "test:c"
2. "test: d"
~/projects/redis-node-client(master) ⚡ node show_keys.js
object
[ { '0': 116
, '1': 101
, '2': 115
, '3': 116
, '4': 58
, '5': 99
, length: 6
}
, { '0': 116
, '1': 101
, '2': 115
, '3': 116
, '4': 58
, '5': 32
, '6': 100
, length: 7
}
]
[ 'test:c', 'test: d' ]
var sys = require('sys'),
redis = require('./lib/redis-client');
var client = redis.createClient();
client.keys('*', function (err, reply) {
sys.puts(typeof reply);
sys.p(reply);
redis.convertMultiBulkBuffersToUTF8Strings(reply);
sys.p(reply);
process.exit(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment