What is the method of assigning values to multiple fields in Redis?

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
Leave a Reply 0

Your email address will not be published. Required fields are marked *