File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed
aggregation/aggregation-tutorials Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,7 @@ Tutorial
90
90
Next, add a :manual:`$sort
91
91
</reference/operator/aggregation/sort>` stage that sorts the
92
92
documents in descending order by the ``dateofbirth`` field to
93
- list the youngest people first. Because Python dictionaries don't maintain the
94
- order of their elements, use a ``SON``or ``OrderedDict`` object
95
- instead:
93
+ list the youngest people first:
96
94
97
95
.. literalinclude:: /includes/aggregation/filtered-subset.py
98
96
:language: python
Original file line number Diff line number Diff line change @@ -137,13 +137,13 @@ constructor accepts. All parameters are optional.
137
137
- ``bson.raw_bson.RawBSONDocument``. To learn more about the ``RawBSONDocument`` class,
138
138
see :ref:`pymongo-bson-raw`.
139
139
140
- - A subclass of the ``collections.abc.Mapping`` type, such as ``bson.son.SON ``.
141
- If you specify ``bson.son.SON`` as the document class , you may also specify types
142
- for the key and value, as shown in the following example:
140
+ - A subclass of the ``collections.abc.Mapping`` type, such as ``OrderedDict ``.
141
+ Depending on the strictness of your type-checking rules , you might also need to
142
+ specify types for the key and value, as shown in the following example:
143
143
144
144
.. code-block:: python
145
145
146
- client = MongoClient(document_class=SON [str, int])
146
+ client = MongoClient(document_class=OrderedDict [str, int])
147
147
148
148
- A subclass of the ``TypedDict`` type. To pass a ``TypedDict`` subclass for this
149
149
parameter, you must also include the class in a type hint for your ``MongoClient``
Original file line number Diff line number Diff line change @@ -232,9 +232,9 @@ the class name. The class can be one of the following types:
232
232
233
233
- ``bson.raw_bson.RawBSONDocument``. To learn more about the ``RawBSONDocument`` class,
234
234
see :ref:`pymongo-bson-raw`.
235
- - A subclass of the ``collections.abc.Mapping`` type, such as ``bson.son.SON ``.
236
- If you specify ``bson.son.SON`` as the document class , you must also specify types
237
- for the key and value.
235
+ - A subclass of the ``collections.abc.Mapping`` type, such as ``OrderedDict ``.
236
+ Depending on the strictness of your type-checking rules , you might also need to
237
+ specify types for the key and value.
238
238
- A subclass of the ``TypedDict`` type. To pass a ``TypedDict`` subclass for this
239
239
parameter, you must also include the class in a type hint for your ``CodecOptions``
240
240
object.
You can’t perform that action at this time.
0 commit comments