SORT_RO

Since 1.1.0KeysChanged in 1.2.1

Syntax

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

History

  • 1.2.1: acl categories: removed generic

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"

ACL

A BY pattern with a *, and any GET other than GET #, read the keys the pattern names, so they need read access to every key, as in Redis. A user whose ACL is limited to some keys gets ERR BY option of SORT denied due to insufficient ACL permissions. or ERR GET option of SORT denied due to insufficient ACL permissions.; BY nosort and GET # need nothing more. Before 1.2, such a user could read any key this way (GHSA-6rw7-4fcr-r6j3).