API中给的hset的demo如下:
var redis = require('redis'),
client = redis.createClient(6379, '192.168.0.218');
client.hset("flights", "784-44871820|CZ455", "2014-06-10", redis.print);
我的疑问是,redis.print输出的是执行的结果,如果这个操作的过程中出现错误了该怎么捕获啊(除了try…catch)?没有如hkeys的用法吗?
client.hkeys("hash key", function (err, replies) {
console.log(replies.length + " replies:");
replies.forEach(function (reply, i) {
console.log(" " + i + ": " + reply);
});
client.quit();
});