HEXISTS

Syntax

  1. HEXISTS key field

Time complexity: O(1)

Returns if field is an existing field in the hash stored at key.

Return

Integer reply, specifically:

  • 1 if the hash contains field.
  • 0 if the hash does not contain field, or key does not exist.

Examples

  1. dragonfly> HSET myhash field1 "foo"
  2. (integer) 1
  3. dragonfly> HEXISTS myhash field1
  4. (integer) 1
  5. dragonfly> HEXISTS myhash field2
  6. (integer) 0