FCALL_RO
FCALL_RO function numkeys [key [key ...]] [arg [arg ...]]
- Group
- Scripting and functions
- Complexity
- Depends on the function
- Arity
- -3 (at least 3 words, counting the command name)
- Flags
- slow, read-only
- HotKV Cloud
- All plans
- On-Premise
- no license needed
FCALL_RO calls a function like FCALL, but only a function
registered with the no-writes flag. Because the command is read-only, you
can send it to read-only replicas and grant it to users who may not write.
Return value
Section titled “Return value”The function’s return value, converted as described for EVAL.
Errors, in addition to those of FCALL:
ERR Can not execute a script with write flag using *_ro command.when the function was registered withoutno-writes.
Examples
Section titled “Examples”127.0.0.1:6379> FUNCTION LOAD "#!lua name=readers\nredis.register_function{function_name='peek', callback=function(keys) return redis.call('GET', keys[1]) end, flags={'no-writes'}}""readers"127.0.0.1:6379> SET greeting "hello"OK127.0.0.1:6379> FCALL_RO peek 1 greeting"hello"Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.