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

Fix the Java example code for Lists using RPUSH #4074

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sanaulla123
Copy link

In the example under Capped List on the documentation page: https://redis.io/docs/latest/develop/data-types/lists/
The Java-Sync library code example is not matching the one given in Redis CLI and also not matching the problem statement: "For example, if you're adding bikes on the end of a list of repairs, but only want to worry about the 3 that have been on the list the longest:"

The right solution is to use rpush and ltrim the first X elements.

This PR fixes the code to match the Redis CLI example.

@sazzad16 sazzad16 changed the title Fixing the Java code to match the redis cli example and the context Fix the Java example code for Lists using RPUSH Jan 31, 2025
@sazzad16
Copy link
Collaborator

@sanaulla123 Thank you for noticing.

@andy-stark-redis No other examples match with redis-cli example.

If you confirm, we can merge this PR. If you want to fix differently, let us know.

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

Successfully merging this pull request may close these issues.

3 participants