@@ -11,6 +11,11 @@ Write Data to MongoDB
11
11
.. meta::
12
12
:keywords: app, odm, code example
13
13
14
+ You can use your application's models to update documents
15
+ stored in the ``sample_mflix`` database. To update documents,
16
+ enter the Python interactive shell and call create, update,
17
+ and delete functions on your model objects.
18
+
14
19
.. procedure::
15
20
:style: connected
16
21
@@ -58,7 +63,7 @@ Write Data to MongoDB
58
63
.. step:: Update your movie object
59
64
60
65
The ``Movie`` object created in the previous step has inaccurate data:
61
- the ``runtime`` value is ``217``, but the correct ``runtime`` is ``117``.
66
+ the ``runtime`` value is ``217``, but the correct ``runtime`` value is ``117``.
62
67
63
68
Run the following code to update the object's ``runtime`` value:
64
69
@@ -71,7 +76,7 @@ Write Data to MongoDB
71
76
72
77
You can also use your ``Viewer`` model to insert documents into the
73
78
``sample_mflix.users`` collection. Run the following code to create
74
- a ``Viewer`` object that stores data about a user named ``"Abigail Carter"``:
79
+ a ``Viewer`` object that stores data about a movie viewer named ``"Abigail Carter"``:
75
80
76
81
.. code-block:: python
77
82
@@ -113,14 +118,14 @@ Write Data to MongoDB
113
118
114
119
.. step:: Render your new objects
115
120
116
- To ensure that your ``Movie`` object was inserted into the database,
121
+ To ensure that you inserted a ``Movie`` object into the database,
117
122
visit the http://127.0.0.1:8000/sample_mflix/recent_movies/ URL.
118
- You should see a list of five movies in the ``sample_mflix.movies``
123
+ You can see a list of five movies in the ``sample_mflix.movies``
119
124
database, with your new movie listed at the top.
120
125
121
- Then, ensure that your ``Viewer`` object was inserted into the
126
+ Then, ensure that you inserted a ``Viewer`` object into the
122
127
database by visiting the http://127.0.0.1:8000/sample_mflix/viewers_list/
123
- URL. You should see a list of ten viewer names in the ``sample_mflix.users``
128
+ URL. You can see a list of ten viewer names in the ``sample_mflix.users``
124
129
database, with your new viewer listed at the top. Ensure that the
125
130
viewer named "Alliser Thorne", deleted in a previous step, does not appear
126
131
in this list.
0 commit comments