hexists
1. 基本語法
hexists(hkey
, subkey
,callback
)
hkey
, subkey
,callback
) 確認hkey
的所有欄位中是否存在subkey
欄位,存在則回傳1,不存在則回傳0。
const dict = {
name: 'Ellie Fredricksen',
gender: 'F',
age: '78',
hobby: 'adventure',
spouse: 'Carl Fredricksen'
};
client.hmset('user:7', dict);
client.hexists('user:7', 'name', redis.print);
client.hexists('user:7', 'offspring', redis.print);
Reply: 1
Reply: 0
Last updated
Was this helpful?