Skip to content

Commit 5e2d5a5

Browse files
edits
1 parent 7a49198 commit 5e2d5a5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

source/pymongo-async-migration.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Migrate to the {+driver-async+} Driver
77
.. contents:: On this page
88
:local:
99
:backlinks: none
10-
:depth: 1
10+
:depth: 2
1111
:class: singlecol
1212

1313
.. facet::
@@ -23,12 +23,12 @@ Overview
2323
The {+driver-async+} driver is a unification of {+driver-short+} and the `Motor
2424
library <https://www.mongodb.com/docs/drivers/motor/>`__. In this guide, you can
2525
identify the changes you must make to migrate an application from
26-
{+driver-short+} or from Motor to the {+driver-async+} driver.
26+
{+driver-short+} or Motor to the {+driver-async+} driver.
2727

2828
Migrate From {+driver-short+}
2929
--------------------
3030

31-
The {+driver-async+} driver behaves nearly identically to {+driver-short+}, but
31+
The {+driver-async+} driver behaves similarly to {+driver-short+}, but
3232
all methods that perform network operations are coroutines and must be awaited.
3333
To migrate from {+driver-short+} to {+driver-async+}, you must update your code
3434
to replace all uses of ``MongoClient`` with ``AsyncMongoClient`` and add the
@@ -61,7 +61,7 @@ Client Methods
6161
- .. code-block:: python
6262

6363
async with await client.watch(...) as stream:
64-
...
64+
...
6565

6666
* - ``server_info()``
6767
- .. code-block:: python
@@ -108,8 +108,7 @@ Database Methods
108108
- .. code-block:: python
109109

110110
async with await client.admin.aggregate(...) as cursor:
111-
async for operation in cursor:
112-
print(operation)
111+
...
113112

114113
* - ``command()``
115114
- .. code-block:: python
@@ -281,11 +280,13 @@ Collection Methods
281280
- .. code-block:: python
282281

283282
async for doc in await collection.aggregate(...):
283+
...
284284

285285
* - ``aggregate_raw_batches()``
286286
- .. code-block:: python
287287

288288
async for batch in await collection.aggregate_raw_batches(...):
289+
...
289290

290291
* - ``rename()``
291292
- .. code-block:: python
@@ -320,8 +321,8 @@ most cases, you can directly migrate existing Motor applications to
320321
{+driver-short+}, changing only the application's import statements, and
321322
by using ``AsyncMongoClient`` in place of ``MotorClient``.
322323

323-
The following section details Motor method signatures that the
324-
{+driver-async+} changes:
324+
The following section shows the method signature changes that you must make when
325+
migrating from Motor to the {+driver-async+} driver:
325326

326327
Method Signature Changes
327328
~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)