Complete the code to store a user profile with embedded address data in Redis using a hash.
HSET user:1000 name "Alice" [1] "123 Main St" city "Springfield"
The key 'street' is used to embed the street address directly in the user hash.
Complete the code to reference an address stored separately by its ID in Redis.
HSET user:1001 name "Bob" address_id [1]
The field 'address_id' holds a reference key 'address:200' pointing to the separate address hash.
Fix the error in the code that tries to embed a list of phone numbers directly in a Redis hash.
HSET user:1002 name "Carol" phones [1]
Redis hashes store strings, so phone numbers should be stored as a comma-separated string without brackets.
Fill in the blank to create a Redis command that retrieves the city from the referenced address hash.
HGET [1] cityThe command retrieves the 'city' field from the address hash with key 'address:300'.
Fill all three blanks to create a Redis Lua script snippet that fetches a user name, then fetches the city from the referenced address hash.
local userKey = [1] local addressKey = redis.call('HGET', userKey, [2]) return redis.call('HGET', addressKey, [3])
The script first sets the user key, then gets the 'address_id' field from the user hash, and finally retrieves the 'city' from the address hash.