Redis 命令 - Transactions
DISCARD
Discard all commands issued after MULTI
127.0.0.1:6379> MGET bank:A:account bank:B:account
1) "400"
2) "600"
127.0.0.1:6379> MULTI
OK
127.0.0.1:6379> DECRBY bank:A:account 100
QUEUED
127.0.0.1:6379> INCRBY bank:B:account 100
QUEUED
127.0.0.1:6379> DISCARD
OK
127.0.0.1:6379> MGET bank:A:account bank:B:account
1) "400"
2) "600"
More: http://redis.io/commands/discard, http://www.redis.cn/commands/discard.html
EXEC
Execute all commands issued after MULTI
127.0.0.1:6379> MSET bank:A:account 500 bank:B:account 500
OK
127.0.0.1:6379> MULTI
OK
127.0.0.1:6379> DECRBY bank:A:account 100
QUEUED
127.0.0.1:6379> INCRBY bank:B:account 100
QUEUED
127.0.0.1:6379> EXEC
1) (integer) 400
2) (integer) 600
More: http://redis.io/commands/exec, http://www.redis.cn/commands/exec.html
MULTI
Mark the start of a transaction block
127.0.0.1:6379> MSET bank:A:account 500 bank:B:account 500
OK
127.0.0.1:6379> MULTI
OK
127.0.0.1:6379> DECRBY bank:A:account 100
QUEUED
127.0.0.1:6379> INCRBY bank:B:account 100
QUEUED
127.0.0.1:6379> EXEC
1) (integer) 400
2) (integer) 600
More: http://redis.io/commands/multi, http://www.redis.cn/commands/multi.html
UNWATCH
Forget about all watched keys
127.0.0.1:6379> WATCH key
OK
......
......
......
127.0.0.1:6379> UNWATCH
OK
More: http://redis.io/commands/unwatch, http://www.redis.cn/commands/unwatch.html
WATCH key [key ...]
Watch the given keys to determine execution of the MULTI/EXEC block
127.0.0.1:6379> SET key 1
OK
127.0.0.1:6379> WATCH key
OK
127.0.0.1:6379> SET key 2
OK
127.0.0.1:6379> MULTI
OK
127.0.0.1:6379> SET key 3
QUEUED
127.0.0.1:6379> EXEC
(nil)
127.0.0.1:6379> GET key
"2"
More: http://redis.io/commands/watch, http://www.redis.cn/commands/watch.html
Redis 命令 - Transactions的更多相关文章
- Redis命令拾遗二(散列类型)
本文版权归博客园和作者吴双共同所有,欢迎转载,转载和爬虫请注明原文地址 :博客园蜗牛NoSql系列地址 http://www.cnblogs.com/tdws/tag/NoSql/ Redis命令拾 ...
- redis命令总结
Redis命令总结 redis 127.0.0.1:6379> info #查看server版本内存使用连接等信息 redis 127.0.0.1:6379> client list ...
- redis如何执行redis命令
Redis 命令 Redis 命令用于在 redis 服务上执行操作.所以我们必须要启动Redis服务程序,也就是redis安装目录下的redis-server.exe,你可以双击执行,也可以打开cm ...
- 常用 redis 命令(for php)
Redis 主要能存储 5 种数据结构,分别是 strings,hashes,lists,sets 以及 sorted sets. 新建一个 redis 数据库 $redis = new Redis( ...
- Redis命令大全&中文解释&在线测试命令工具&在线中文文档
在线测试命令地址:http://try.redis.io/ 官方文档:http://redis.io/commands http://redis.io/documentation Redis 命令参考 ...
- Redis命令
redis的常用命令主要分为两个方面.一个是键值相关命令.一个是服务器相关命令(redis-cli进入终端) 1.键值相关命令 keys * 取出当前所有的key exists name 查看n是否有 ...
- redis命令参考
http://doc.redisfans.com/ 进入redis命令行模式方式: 1.进入redis安装目录 2.运行redis-cli
- Redis 命令参考
Redis 命令参考 http://redis.readthedocs.org/en/latest/index.html
- Redis 命令总结
Redis命令总结 连接操作相关的命令 quit:关闭连接(connection) auth:简单密码认证 持久化 save:将数据同步保存到磁盘 bgsave:将数据异步保存到磁盘 lastsa ...
随机推荐
- SQl函数的写法
USE [ChangHong_612]GO/****** Object: UserDefinedFunction [dbo].[FN_GetProdQty] Script Date: 10/08/20 ...
- word2007 每页显示表头
word2007 每页显示表头 在Word 2007文档中,如果一张表格需要在多页中跨页显示,则设置标题行重复显示很有必要,因为这样会在每一页都明确显示表格中的每一列所代表的内容.在Word 2007 ...
- android ipc通信机制之二序列化接口和Binder
IPC的一些基本概念,Serializable接口,Parcelable接口,以及Binder.此核心为最后的IBookManager.java类!!! Serializable接口,Parcelab ...
- OOP设计模式[JAVA]——03职责链模式
职责链模式 Responsibility of Chain 在职责链模式里,很多对象由每一个对象对其下家的引用而连接起来形成一条链.请求在这个链上传递,直到链上的某一个对象决定处理此请求.发出这个请求 ...
- 怎么修改路由器地址的默认IP
参考文章:http://jingyan.baidu.com/article/4b52d7026e14effc5c774b30.html 一.怎么修改路由器地址的默认IP 目前绝大多数品牌有线或无线路 ...
- Codeforces Round #328 (Div. 2) A. PawnChess 暴力
A. PawnChess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/ ...
- Codeforces Round #326 (Div. 2) B. Duff in Love 分解质因数
B. Duff in Love Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/proble ...
- Codeforces Gym 100570 E. Palindrome Query Manacher
E. Palindrome QueryTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100570/pro ...
- 关于学习netty的两个完整服务器客户端范例
https://github.com/wangyi793797714/IMServer https://github.com/wangyi793797714/IMClient https://gith ...
- fedora 20 注销
当系统只有一个用户和只有一个桌面环境时,Fedora 20将不会显示Log Out菜单. 如果你确实需要logout,可以通过执行gnome-session-quit命令来logout. 如果你确实需 ...