Writing a query to add multiple values to a key in REDIS Hashes?

Viewed 33923

I went through the command list on REDIS Hashes.Is it possible to assign multiple values to a hash key in REDIS? For instance,I am trying to represent the following table in form of a hash.

 Prod_Color  |   Prod_Count  |   Prod_Price   |   Prod_Info
------------------------------------------------------------
  Red        |       12      |       300      |   In Stock
  Blue       |        8      |       310      |   In Stock

I tried the following hash commands subsequently

HMSET Records Prod_Color "Red" Prod_Count 12 Prod_Price 300 Prod_Info "In Stock"

HMSET Records Prod_Color "Blue" Prod_Count 8 Prod_Price 310 Prod_Info "In Stock"

However,when I try to retrieve the hash using the command HGETALL Records, I am seeing only the second row of inserted values(i.e. Blue,8,310,In Stock)! I understand that I can create a separate hash and insert the second row of values,however, I intend to insert all the values in a single hash.

3 Answers
Related