Skip to content

Commit 9d7a939

Browse files
committed
DOCSP-48328: Serialization page feedback (#220)
(cherry picked from commit 91fe34f)
1 parent 333fcff commit 9d7a939

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/serialization.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,17 @@ serialized object into a collection:
6565
self.name = name
6666
self.cuisine = cuisine
6767

68-
restaurant = Guitar("Example Cafe", "Coffee")
68+
restaurant = Restaurant("Example Cafe", "Coffee")
6969
restaurant_dict = vars(restaurant)
7070

7171
collection.insert_one(restaurant_dict)
7272

73+
The preceding example serializes the ``Restaurant`` object into the following dictionary:
74+
75+
.. code-block:: none
76+
77+
{'name': 'Example Cafe', 'cuisine': 'Coffee'}
78+
7379
To learn more about inserting documents into a collection, see the :ref:`pymongo-write-insert`
7480
guide.
7581

0 commit comments

Comments
 (0)