Redis脚本
来源:互联网 发布:戴予桐 直播软件 编辑:程序博客网 时间:2024/06/01 23:49
Redis脚本用于使用Lua解释器来执行脚本。从Redis 2.6.0版开始内置到Redis中。使用脚本的命令是EVAL命令。
语法
以下是EVAL命令的基本语法。
redis 127.0.0.1:6379> EVAL script numkeys key [key …] arg [arg …]
示例
以下示例说明了Redis脚本的工作原理。
redis 127.0.0.1:6379> EVAL “return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}” 2 key1
key2 first second
1) “key1”
2) “key2”
3) “first”
4) “second”
Redis脚本命令
下表列出了与Redis脚本相关的一些基本命令。
序号 命令 说明
1 EVAL script numkeys key [key …] arg [arg …] 执行一个Lua脚本。
2 EVALSHA sha1 numkeys key [key …] arg [arg …] 执行一个Lua脚本。
3 SCRIPT EXISTS script [script …] 检查脚本缓存中是否存在脚本。
4 SCRIPT FLUSH 从脚本缓存中删除所有脚本。
5 SCRIPT KILL 杀死当前正在执行的脚本。
6 SCRIPT LOAD script 将指定的Lua脚本加载到脚本缓存中。
阅读全文
0 0
- Redis脚本
- Redis脚本
- Redis 脚本
- Redis脚本
- Redis脚本
- Redis 脚本
- Redis 脚本
- Redis导数据脚本
- redis启动脚本
- 一起写redis脚本
- 脚本启动redis
- Redis Lua脚本原理
- Redis脚本使用总结
- redis执行Lua脚本
- Redis与Lua脚本
- Redis 与 Lua 脚本
- Redis 与 Lua 脚本
- redis使用Lua脚本
- 浅析Python3中的bytes和str类型
- 3.Actitity的生命周期
- [cv] optical flow
- java常用类:List接口常用方法
- [jzoj]1262. 为奶牛熄灯(迭代加深搜索+一堆优化vs记忆化vs状压DP)
- Redis脚本
- sdut-1117 C语言实验——求绝对值(选择结构)
- Error:此运算符的参数太多
- 【Luogu P1048 Luogu P1016】采药/疯狂的采药
- JAVA设计模式--单例模式
- python定向爬虫——爬取某代理Ip网站上的所有ip
- paly 框架Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
- Ext JS 6:将日期字段修改为日期时间字段(二)
- 完整版文本框即时输入数据监听并下拉显示匹配数据