ZSetOperations接口的Boolean add(K key, V value, double score)方法

文档地址 https://docs.spring.io/spring-data/redis/docs/current/api/org/springframework/data/redis/core/ZSetOperations.html#add(K,V,double)

ZSetOperations.add

@Nullable
Boolean add(K key, V value, double score)

将值添加到键的有序集合中,或者如果已经存在则更新其分数。
Add value to a sorted set at key, or update its score if it already exists.

Parameters:

  • key - must not be null.
  • value - the value.
  • score - the score.

Returns: null when used in pipeline / transaction.

See Also: Redis Documentation: ZADD https://redis.io/docs/latest/commands/zadd/

posted @ 2025-04-11 20:53  kuki'  阅读(21)  评论(0)    收藏  举报