Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support NX|XX|CH|INCR options in ZADD #74

Closed
mp911de opened this issue Jun 5, 2015 · 2 comments
Closed

Support NX|XX|CH|INCR options in ZADD #74

mp911de opened this issue Jun 5, 2015 · 2 comments
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Jun 5, 2015

ZADD options (Redis 3.0.2 or greater)
ZADD supports a list of options, specified after the name of the key and before the first score argument. Options are:

  • XX: Only update elements that already exist. Never add elements.
  • NX: Don't update already existing elements. Always add new elements.
  • CH: Modify the return value from the number of new elements added, to the total number of elements changed (CH is an abbreviation of changed). Changed elements are new elements added and elements already existing for which the score was updated. So elements specified in the command line having the same score as they had in the past are not counted. Note: normally the return value of ZADD only counts the number of new elements added.
  • INCR: When this option is specified ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode.
@mp911de mp911de added this to the Lettuce 3.3 milestone Jun 5, 2015
@mp911de mp911de closed this as completed Jun 6, 2015
@ktalg
Copy link

ktalg commented Aug 27, 2020

@mp911de dose Spring Data Redis support this?
I can only find two method about zadd in SDR(v2.1.5):

	Boolean add(K key, V value, double score);
	Long add(K key, Set<TypedTuple<V>> tuples);

but it seem that the only two method didn't provide NX|XX|CH|INCR options.
Thank you.

@lijian0706
Copy link

I have the same question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants