Challenge 3: Model a Product as a Hash — Possible Solution ==================================================================== 127.0.0.1:6379> HSET product:200 name "Wireless Mouse" price "24.99" category "electronics" (integer) 3 127.0.0.1:6379> HGETALL product:200 1) "name" 2) "Wireless Mouse" 3) "price" 4) "24.99" 5) "category" 6) "electronics" WHY THIS WORKS AS AN ANSWER ------------------------------ HSET product:200 followed by alternating field-name/value pairs sets all three fields in a single command, returning 3 — the number of NEW fields that were set (matching HSET's return behavior from this chapter's HSET user:104 example, which returned 2 for its two fields). HGETALL product:200 then reads back every field-value pair stored under that one key, confirming all three fields are present with the correct values. Using a single hash here — rather than three separate string keys like product:200:name, product:200:price, and product:200:category — is exactly this chapter's comparison-box point: the product is naturally one object with several related fields, so one hash key groups them together cleanly, rather than scattering them across multiple loosely related top-level keys that all happen to share a naming prefix.