@@ -29,8 +29,8 @@ types into BSON when you insert a document into a collection. Similarly, when yo
29
29
document from a collection, {+driver-short+} automatically converts the returned BSON
30
30
back into the corresponding {+language+} types.
31
31
32
- The following list shows some {+language +} types that {+driver-short+} can serialize
33
- and deserialize :
32
+ You can use {+driver-short +} to serialize and deserialize the following {+language+}
33
+ types :
34
34
35
35
- ``str``
36
36
- ``int``
@@ -55,7 +55,7 @@ Serializing Custom Classes
55
55
~~~~~~~~~~~~~~~~~~~~~~~~~~
56
56
57
57
To serialize a custom class, you must convert the class to a dictionary. The following
58
- example serializes a custom class by using the ``vars()`` method, then inserts the
58
+ example serializes a custom class by using the ``vars()`` method, and then inserts the
59
59
serialized object into a collection:
60
60
61
61
.. code-block:: python
@@ -77,7 +77,7 @@ Deserializing Custom Classes
77
77
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
78
79
79
To deserialize a custom class, you must convert the dictionary back into an instance of
80
- the class. The following example retrieves a document from a collection, then converts
80
+ the class. The following example retrieves a document from a collection, and then converts
81
81
it back into a ``Restaurant`` object from the preceding example:
82
82
83
83
.. code-block:: python
@@ -95,9 +95,9 @@ Serializing Ordered Documents
95
95
-----------------------------
96
96
97
97
Because the key-value pairs in {+language+} dictionaries are unordered, the order of
98
- fields in serialized BSON documents can differ from the order of fields in the original
98
+ fields in serialized BSON documents can differ from the original
99
99
dictionary. This behavior can cause issues when {+driver-short+} compares subdocuments
100
- to each other, since {+driver-short+} only considers subdocuments to be equal if their fields
100
+ to each other, because {+driver-short+} only considers subdocuments to be equal if their fields
101
101
are in identical order.
102
102
103
103
To preserve the order of keys when serializing and deserializing BSON,
0 commit comments