diff --git a/source/serialization.txt b/source/serialization.txt index c71c0035..723e7d5e 100644 --- a/source/serialization.txt +++ b/source/serialization.txt @@ -65,11 +65,17 @@ serialized object into a collection: self.name = name self.cuisine = cuisine - restaurant = Guitar("Example Cafe", "Coffee") + restaurant = Restaurant("Example Cafe", "Coffee") restaurant_dict = vars(restaurant) collection.insert_one(restaurant_dict) +The preceding example serializes the ``Restaurant`` object into the following dictionary: + +.. code-block:: none + + {'name': 'Example Cafe', 'cuisine': 'Coffee'} + To learn more about inserting documents into a collection, see the :ref:`pymongo-write-insert` guide.