Upsert (Replace)
- Update If Exists
- Insert If Not Exists
(Using Primary Key as Pipel开发者_如何学编程ined)
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.
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.
精彩评论