SORT_RO

Since 1.1.0Keys

Syntax

SORT_RO key [BY pattern] [LIMIT offset count] [GET pattern [...]] [ASC|DESC] [ALPHA]
  • Flags: movablekeys, readonly
  • ACL categories: @generic, @keyspace, @read, @slow
  • Arity: -2

SORT without STORE: it only reads, so it can be sent to a read-only replica.

Reply

  • The sorted elements, or what GET reads.
  • ERR syntax error if STORE is given.

Examples

> RPUSH nums 3 1 2
(integer) 3
> SORT_RO nums
1) "1"
2) "2"
3) "3"