Redis HMSET: Setting Multiple Hash Fields

In Redis, the HMSET command can be used to simultaneously set multiple fields in a hash table. The specific syntax is as follows:

HMSET key field1 value1 field2 value2 ...

To assign the values “Alice” and 30 to the fields name and age in the hash table user:1000, you can use the following command:

HMSET user:1000 name Alice age 30
bannerAds