-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Is HDEL
supposed to be used as the following?:
client.hdel( my_key, [ field1, field2, ...] , callback );
or:
client.hdel( [ my_key, field1, field2, ...] , callback );
Right now, with node-redis 0.8.2
, (no hiredis
), the second approach works perfectly, The first approach only works with an array of length 1: [ field1 ]
. Is this the correct behaviour? Or should it be the first approach?
Here is a more complete code example:
var redis = require("redis"),
client = redis.createClient();
client.hmset("my_hash", {a: "a", b: "b"}, function (e, r) {
redis.print(e,r);
client.hmset("my_hash", {c: "c", d: "d"}, function (e, r) {
redis.print(e,r);
client.hdel('my_hash', ['a', 'c', 'd'], function (e, r) {
redis.print(e,'This does not work: instead of 3 we get: ' + r);
client.hdel("my_hash", 'a', 'c', 'd', function (e, r) {
redis.print(e,'We get what we want using this approach: ' + r);
client.quit();
});
});
});
});