What is the difference between HSET and HMSET method in redis database

前端 未结 3 1530
被撕碎了的回忆
被撕碎了的回忆 2021-02-01 12:11

In my application im using redis database.I have gone through their documentation but i couldn\'t find the difference between HSET and HMSET.

3条回答
  •  梦如初夏
    2021-02-01 12:52

    The only difference between the commands HSET and HMSET is the return value of the commands.

    HSET return value (Integer reply):

    • # if the field is a new field in the hash and value was set. (where # is the number of new fields created )
    • 0 if the field already exists in the hash and the value was updated.

    HMSET returns a simple string as a reply.

提交回复
热议问题