RedisTemplate中的delete(K key)方法

文档地址 https://docs.spring.io/spring-data/redis/docs/current/api/org/springframework/data/redis/core/RedisTemplate.html#delete(java.util.Collection)

delete

public Boolean delete(K key)

Description copied from interface: RedisOperations

Delete given key.

Specified by:
delete in interface RedisOperations<K,V>

Parameters:

  • key - must not be null.

Returns:
true if the key was removed.

See Also:
Redis Documentation: DEL https://redis.io/docs/latest/commands/del/

Redis中

Removes the specified keys. A key is ignored if it does not exist.

stringRedisTemplate.delete(LOGIN_CODE_KEY + phone);
posted @ 2025-04-12 14:42  kuki'  阅读(2)  评论(0)    收藏  举报