Skip to content

Commit 1bd55b0

Browse files
author
Joohwan Oh
committed
Update README.md
1 parent a976539 commit 1bd55b0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,26 @@ self.db.execute_batch([
349349
])
350350
```
351351

352+
## Transactions
353+
```python
354+
# Execute a transaction
355+
action = """
356+
function () {
357+
var db = require('internal').db;
358+
db.col01.save({ _key: 'doc01'});
359+
db.col02.save({ _key: 'doc02'});
360+
return 'success!';
361+
}
362+
"""
363+
res = self.arango.execute_transaction(
364+
action=action,
365+
read_collections=["col01","col02"],
366+
write_collections=["col01", "col02"],
367+
wait_for_sync=True,
368+
lock_timeout=10000
369+
)
370+
```
371+
352372
## Running System Tests (requires ArangoDB on localhost)
353373
```bash
354374
nosetests

0 commit comments

Comments
 (0)