# 기초

* Start a session

```python
session = client.start_session()
session.end_session()
```

* You can use it instead of above in Python.

```python
with client.start_session() as s:
    pass
```

* You can start, commit, abort a transaction

```python
session.start_transaction()
session.commit_transaction()
session.abort_transaction()
```

* Just pass a session argument with CURD Syntax

```python
col.insert_one({'_id': 0}, session=session)
col.find({}, session=session)
collection.update_one({'_id': 1}, {'$set': {'x': 10}}, session=session)
collection.delete_many({'_id': 2}, session=session)
```
