Skip to content

Commit 408e5d3

Browse files
committed
fix
1 parent c4f3895 commit 408e5d3

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

source/write/bulk-write.txt

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -553,37 +553,6 @@ The ``MongoClient.bulk_write()`` method returns a ``ClientBulkWriteResult`` obje
553553
* - ``upserted_count``
554554
- | The number of documents upserted, if any.
555555

556-
Type Hints
557-
----------
558-
559-
.. include:: /includes/type-hints/intro.rst
560-
561-
When you use the ``bulk_write()`` method to perform an ``InsertOne`` or ``ReplaceOne``
562-
operation,
563-
The following code example shows how to insert
564-
- ``~pymongo.collection.Collection.bulk_write()``
565-
566-
For ``bulk_write()``, both the ``~pymongo.operations.InsertOne()`` and
567-
``~pymongo.operations.ReplaceOne()`` operators are generic.
568-
569-
The following code example shows that the results are the same as the preceding examples
570-
when you call the ``bulk_write()`` method:
571-
572-
.. code-block:: python
573-
574-
from typing import TypedDict
575-
from pymongo import MongoClient
576-
from pymongo.operations import InsertOne
577-
from pymongo.collection import Collection
578-
client: MongoClient = MongoClient()
579-
collection: Collection[Movie] = client.test.test
580-
inserted = collection.bulk_write([InsertOne(Movie(name="Jurassic Park", year=1993))])
581-
result = collection.find_one({"name": "Jurassic Park"})
582-
assert result is not None
583-
assert result["year"] == 1993
584-
585-
.. include:: /includes/type-hints/tip-more-info.rst
586-
587556
Troubleshooting
588557
---------------
589558

0 commit comments

Comments
 (0)