Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 'How to make multiple writes in a transaction' page under 'Tuto…
…rials' section and updated the Demo page (#517) * Added 'How to make multiple writes in a transaction' page and updated demo page
- Loading branch information
Showing
2 changed files
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
content/en/docs/v3.5/tutorials/how-to-transactional-write.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: How to make multiple writes in a transaction | ||
description: Guide to making transactional writes | ||
--- | ||
|
||
`txn` to wrap multiple requests into one transaction: | ||
|
||
![05_etcdctl_transaction_2016050501](https://storage.googleapis.com/etcd/demo/05_etcdctl_transaction_2016050501.gif) | ||
|
||
```shell | ||
etcdctl --endpoints=$ENDPOINTS put user1 bad | ||
etcdctl --endpoints=$ENDPOINTS txn --interactive | ||
|
||
compares: | ||
value("user1") = "bad" | ||
|
||
success requests (get, put, delete): | ||
del user1 | ||
|
||
failure requests (get, put, delete): | ||
put user1 good | ||
``` |