HDEL, HSET not working in NodeJS
15,350
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);
Comments
-
Arjun Bajaj almost 2 years
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.
-
Arjun Bajaj over 11 yearsAlthough I figured it out just before u answered, thanks for clarifying the methods. :D