Node-redis: Support of set with options

Created on 11 Jul 2013  路  3Comments  路  Source: NodeRedis/node-redis

http://redis.io/commands/set supports options like XX. Is it possible to use them? I tried

client.set(key, value, "PX expiry", function (err) {});
client.set(key, value, {PX:  expiry}, function (err) {});

which does not work.

question

Most helpful comment

Could this be clarified with regards to expiry (like http://redis.io/commands/expire) in the documentation for node_redis?

All 3 comments

It does indeed work! :smile_cat:

Set "foo" to "bar" expiring in 10 seconds, but only if key "foo" already exists:

r.set("foo", "bar", "EX", 10, "XX")

That's even quiet obvious... :D thanks!

Could this be clarified with regards to expiry (like http://redis.io/commands/expire) in the documentation for node_redis?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

twappworld picture twappworld  路  7Comments

juriansluiman picture juriansluiman  路  3Comments

Stono picture Stono  路  6Comments

yuany picture yuany  路  4Comments

aletorrado picture aletorrado  路  6Comments