@@ -28,16 +28,6 @@ you to alter and update databases in the future, there aren't rigid schemas.
2828However, Mongoose enforces a semi-rigid schema from the beginning, so
2929you must define a schema and model.
3030
31- In this tutorial, you will perform the following actions:
32-
33- - Set up your environment to use Mongoose
34- - Connect to MongoDB
35- - Create a Mongoose schema and model
36- - Insert, update, find, and delete data
37- - Project document fields
38- - Validate your data
39- - Use multiple schemas and middleware
40-
4131Schemas
4232~~~~~~~
4333
@@ -145,8 +135,21 @@ For more information, see the `Model.where()
145135<https://mongoosejs.com/docs/api/model.html#Model.$where()>`__ section of the
146136Mongoose API documentation.
147137
138+ Tutorial
139+ --------
140+
141+ In this tutorial, you will perform the following actions:
142+
143+ - Set up your environment to use Mongoose
144+ - Connect to MongoDB
145+ - Create a Mongoose schema and model
146+ - Insert, update, find, and delete data
147+ - Project document fields
148+ - Validate your data
149+ - Use multiple schemas and middleware
150+
148151Prerequisites
149- -------------
152+ ~~~~~~~~~~~~~
150153
151154Before you begin this tutorial, perform the following actions:
152155
@@ -185,7 +188,7 @@ Before you begin this tutorial, perform the following actions:
185188 "type": "module",
186189 ...
187190
188- .. step:: Connect to MongoDB
191+ .. step:: Connect to MongoDB.
189192
190193 In the root level of your project, create a file named ``index.js`` and
191194 add the following code to the top of the file:
@@ -201,7 +204,7 @@ Before you begin this tutorial, perform the following actions:
201204 string, see the :atlas:`Connect to Your Cluster
202205 </tutorial/connect-to-your-cluster>` tutorial in the Atlas documentation.
203206
204- .. step:: Create a Schema and Model
207+ .. step:: Create a schema and a model.
205208
206209 Before you start adding and updating data in MongoDB, you must create a
207210 schema and model.
@@ -215,7 +218,7 @@ Before you begin this tutorial, perform the following actions:
215218 :language: javascript
216219 :dedent:
217220
218- .. step:: Perform CRUD Operations
221+ .. step:: Perform CRUD operations.
219222
220223 You now have your first model and schema set up, and you can start
221224 inserting data into the database. The following sections show you how to
@@ -422,7 +425,7 @@ Before you begin this tutorial, perform the following actions:
422425
423426 Deleted Many Blogs: { acknowledged: true, deletedCount: 4 }
424427
425- .. step:: Validate Your Data
428+ .. step:: Validate your data.
426429
427430 The articles inserted in the previous steps do not contain the ``author``,
428431 ``dates``, or ``comments`` fields, even though these fields are included
@@ -462,7 +465,7 @@ Before you begin this tutorial, perform the following actions:
462465
463466 Validators only run on the ``create()`` and ``save()`` methods.
464467
465- .. step:: Introduce Multiple Schemas
468+ .. step:: Introduce multiple schemas.
466469
467470 Now that you have validation on your blog schema, and the ``author`` field is
468471 ``required``, you must update ``index.js`` to include the ``author``. To do
@@ -593,7 +596,7 @@ Before you begin this tutorial, perform the following actions:
593596 article. Mongoose uses the MongoDB ``$lookup`` method to populate the data
594597 automatically.
595598
596- .. step:: Add Middleware
599+ .. step:: Add middleware.
597600
598601 In Mongoose, middleware are functions that run before, or during, the
599602 execution of asynchronous functions at the schema level.
0 commit comments