We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 333fcff commit 9d7a939Copy full SHA for 9d7a939
source/serialization.txt
@@ -65,11 +65,17 @@ serialized object into a collection:
65
self.name = name
66
self.cuisine = cuisine
67
68
- restaurant = Guitar("Example Cafe", "Coffee")
+ restaurant = Restaurant("Example Cafe", "Coffee")
69
restaurant_dict = vars(restaurant)
70
71
collection.insert_one(restaurant_dict)
72
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
79
To learn more about inserting documents into a collection, see the :ref:`pymongo-write-insert`
80
guide.
81
0 commit comments