Hash
HEXISTS
Checks if a field exists in a hash.
await redis.hset("key", "field", "value");
const exists = await redis.hexists("key", "field");
console.log(exists); // 1
Arguments
key
string
requiredThe key to get.
field
string
requiredThe field to check.
Response
1
if the hash contains field
. 0
if the hash does not contain field
, or key
does not exist.
await redis.hset("key", "field", "value");
const exists = await redis.hexists("key", "field");
console.log(exists); // 1