can anyone tell me what is wrong in this code?
redis.hdel("hash:" + id + " key" function(err, success) {
console.log("Hash Deleted");
});
Is there any other way to do it?
And I'm also struggling with HSET:
redis.hset("hash:" + id + " key", "true");
It tells me "wrong number of arguments". What more is it expecting? In the Redis documentation of HSET, there are no more parameters.
So I used HMSET instead, and it works properly. :)
Also, if anyone can tell me, some source where I can find examples of all commands or at least all the hash commands in NodeJS.
Thanks.
HSET
takes three parameters, key
, field
, value
. HDEL
takes two, key
and field
. Have you tried, as per the readme:
client.hset("key", "field", "value", callback);
Similarly,
client.hdel("key", "field", callback);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With