Skip to content

Commit

Permalink
Added 'How to make multiple writes in a transaction' page under 'Tuto…
Browse files Browse the repository at this point in the history
…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
Somoshree committed Oct 13, 2021
1 parent 2e76aee commit 2223e6b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
21 changes: 0 additions & 21 deletions content/en/docs/v3.5/demo.md
Expand Up @@ -122,27 +122,6 @@ etcdctl --endpoints=$ENDPOINTS put web3 value3
etcdctl --endpoints=$ENDPOINTS get web --prefix
```

## Transactional write

`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
```


## Lease

`lease` to write with TTL:
Expand Down
22 changes: 22 additions & 0 deletions content/en/docs/v3.5/tutorials/how-to-transactional-write.md
@@ -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
```

0 comments on commit 2223e6b

Please sign in to comment.