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

b96705008 picture b96705008  路  7Comments

dotSlashLu picture dotSlashLu  路  5Comments

Alchemystic picture Alchemystic  路  6Comments

strumwolf picture strumwolf  路  4Comments

id0Sch picture id0Sch  路  4Comments