Last updated 3 years ago
Was this helpful?
表示:Redis 4.0.0開始, 語法已支援設置多組鍵值對資料
hkey
subkey, value[, subkey, value, ...]
callback
為hkey一次設置多組subkey與value的鍵值對資料。
subkey
value
subkey[, subkey, ...]
回傳hkey底下多組subkey對應的資料內容。
const dict = { name: 'Brooks Hatlen', gender: 'M', age: '73' }; client.hmset('user:2', dict); client.hmget('user:2', 'name', 'age', (err, vals) => { console.log(vals); });
[ 'Brooks Hatlen', '73' ]