hexists

1. 基本語法

hexists(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?