
- Redis Basics
- Redis - Home
- Redis - Overview
- Redis - Environment
- Redis - Configuration
- Redis - Data types
- Redis Commands
- Redis - Commands
- Redis - Keys
- Redis - Strings
- Redis - Hashes
- Redis - Lists
- Redis - Sets
- Redis - Sorted Sets
- Redis - HyperLogLog
- Redis - Publish Subscribe
- Redis - Transactions
- Redis - Scripting
- Redis - Connections
- Redis - Server
- Redis Advanced
- Redis - Backup
- Redis - Security
- Redis - Benchmarks
- Redis - Client Connection
- Redis - Pipelining
- Redis - Partitioning
- Redis - Java
- Redis - Php
- Redis Useful Resources
- Redis - Quick Guide
- Redis - Useful Resources
- Redis - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Redis - Sorted Set Zrangebyscore Command
Redis ZRANGEBYSCORE command returns all the elements in the sorted set at the key with a score between min and max (including elements with score equal to min or max). The elements are considered to be ordered from low to high scores. The elements having the same score are returned in lexicographical order (this follows from a property of the sorted set implementation in Redis and does not involve further computation).
Return Value
Array reply, list of elements in the specified score range (optionally with their scores).
Syntax
Following is the basic syntax of Redis ZRANGEBYSCORE command.
redis 127.0.0.1:6379> ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
Example
redis 127.0.0.1:6379> ZADD myzset 0 a 1 b 2 c 3 d 4 e (integer) 5 redis 127.0.0.1:6379> ZADD myzset 5 f 6 g (integer) 2 redis 127.0.0.1:6379> ZRANGEBYSCORE myzset 1 2 1) "b" 2) "c" redis 127.0.0.1:6379> ZRANGEBYSCORE myzset (1 2 1) "b"
redis_sorted_sets.htm
Advertisements