HEXISTS

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Synopsis

HEXISTS key fieldThis is a predicate to check whether or not the given field exists in the hash that is specified by the given key.

  • If the given key and field exist, 1 is returned.
  • If the given key or field does not exist, 0 is returned.
  • If the given key is associated with non-hash data, an error is raised.

Return Value

Returns existence status as integer, either 1 or 0.

Examples

You can do this as shown below.

  1. $ HSET yugahash area1 "America"
  1. 1
  1. $ HEXISTS yugahash area1
  1. 1
  1. $ HEXISTS yugahash area_none
  1. 0

See Also

hdel, hget, hgetall, hkeys, hlen, hmget, hmset, hset, hincrby, hstrlen, hvals