4
votes

Upsert (Replace)

  • Update If Exists
  • Insert If Not Exists

(Using Primary Key as Pipelined)

2

2 Answers

18
votes

What do you mean by "update if exists"? The standard Redis SET commands (SET, MSET, HSET, LSET, etc.) will update (overwrite) an existing key if the key already exists or insert a new key if the key doesn't already exist.

Sounds like you are asking for the default behavior.

0
votes

there are other data structures supported by redis for example SET, Sorted SET and SET command works for String values only as it expects a string key and string value.