Пример #1
0
 public boolean hexists(String key, Object field) {
   hashOps = redisTemplate.opsForHash();
   return hashOps.hasKey(key, field);
 }
Пример #2
0
 /**
  * Hash数据类型 查找 key绑定的hash集合中hashKey 的元素是否存在
  *
  * @param key
  * @param hashKey
  * @return true存在 false不存在
  */
 public boolean hasHashKey(String key, Object hashKey) {
   hashOps = redisTemplate.opsForHash();
   return hashOps.hasKey(key, hashKey);
 }