How Remove One Element with a Score in Redis?

How to remove one element in sorted set by score in Redis? If I need to remove element with a score timestamp 1417727661 will be right?

ZREMRANGEBYSCORE key 1417727661

Or ZREMRANGEBYSCORE key 1417727661 1417727661

1 Answer

This is the full documentation of that call:

It looks like for your case, ZREMRANGEBYSCORE key 1417727661 1417727661 is correct. Remember that the ranges are inclusive by default. You can make them exclusive by following the syntax on this page:

ZREMRANGEBYSCORE key 1417727661 (1417727662

means scores greater than or equal to 1417727661 but less than 1417727662

7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest