From f73c661c4f1eead478ab63f0435f0187647a876f Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Wed, 12 Mar 2025 14:19:55 -0400 Subject: [PATCH 1/2] DOCSP-48328: Serialization page feedback --- source/serialization.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/serialization.txt b/source/serialization.txt index c71c0035..1dc6aec9 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 above 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. From ea1b88cf67cf941fc8d11969a5eff989c7a880c6 Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Wed, 12 Mar 2025 14:20:20 -0400 Subject: [PATCH 2/2] Fix --- source/serialization.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/serialization.txt b/source/serialization.txt index 1dc6aec9..723e7d5e 100644 --- a/source/serialization.txt +++ b/source/serialization.txt @@ -70,7 +70,7 @@ serialized object into a collection: collection.insert_one(restaurant_dict) -The above example serializes the ``Restaurant`` object into the following dictionary: +The preceding example serializes the ``Restaurant`` object into the following dictionary: .. code-block:: none