pixel
pixel

Reputation: 26513

Option to set multiple keys in redis for nonexistent keys?

From documentation of MSETNX:

Sets the given keys to their respective values. MSETNX will not perform any operation at all even if just a single key already exists.

I would like to perform an operation that would add keys which are not present in redis and skip those that are already present.

Is there any command that perform such action?

Upvotes: 0

Views: 320

Answers (1)

Carlos Abalde
Carlos Abalde

Reputation: 1087

Sorry if stating the obvious here, but EVAL / EVALSHA + a simple Lua script could easily and efficiently do the job.

Upvotes: 3

Related Questions