@@ -105,7 +105,9 @@ method for added type safety:
105105 class Restaurant(TypedDict):
106106 name: str
107107
108- sample_restaurants.restaurants.insert_one(Movie(name="Mongo's Burgers")
108+ sample_restaurants.restaurants.insert_one(Restaurant(name="Mongo's Burgers")
109+
110+ .. include:: /includes/type-hints/tip-type-checkers.rst
109111
110112Insert Multiple Documents
111113-------------------------
@@ -149,6 +151,8 @@ instances of the ``Restaurant`` class. This adds type safety to the insert opera
149151
150152 sample_restaurants.restaurants.insert_many(document_list)
151153
154+ .. include:: /includes/type-hints/tip-type-checkers.rst
155+
152156Modify Insert Behavior
153157----------------------
154158
@@ -233,7 +237,7 @@ calling the ``insert_many()`` method instead.
233237TypedDict Missing _id Key
234238~~~~~~~~~~~~~~~~~~~~~~~~~
235239
236- As discussed above, if you don't specify the ``_id`` field, {+driver-short+} automatically
240+ If you don't specify the ``_id`` field, {+driver-short+} automatically
237241inserts it into the document.
238242You can retrieve the value of the ``_id`` field at runtime, but if you use MyPy or another
239243tool to perform static type-checking, it won't find the ``_id`` field in your class and
@@ -341,8 +345,10 @@ The following code example shows how to implement this solution:
341345
342346.. important:: NotRequired Requires Python 3.11+
343347
344- The ``NotRequired`` class is available only in Python 3.11 and later.
345- To use ``NotRequired`` in earlier versions of Python, install the ``typing_extensions``
348+ The `NotRequired <https://docs.python.org/3/library/typing.html#typing.NotRequired>`__
349+ class is available only in Python 3.11 and later.
350+ To use ``NotRequired`` in earlier versions of Python, install the
351+ `typing_extensions <https://pypi.org/project/typing-extensions/>`__
346352 package instead.
347353
348354Additional Information
0 commit comments