Skip to content

Commit df13c4a

Browse files
committed
update section heading hierarchy
1 parent 098022e commit df13c4a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

source/integrations/mongoose-get-started.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Get Started with Mongoose
1515
.. contents:: On this page
1616
:local:
1717
:backlinks: none
18-
:depth: 1
18+
:depth: 2
1919
:class: singlecol
2020

2121
Overview
@@ -39,7 +39,7 @@ In this tutorial, you will perform the following actions:
3939
- Use multiple schemas and middleware
4040

4141
Schemas
42-
-------
42+
~~~~~~~
4343

4444
A schema defines the structure of your collection documents. A Mongoose schema
4545
maps directly to a MongoDB collection.
@@ -67,7 +67,7 @@ following types are permitted:
6767
- Map
6868

6969
Models
70-
------
70+
~~~~~~
7171

7272
Models take your schema and apply it to each document in its collection. Models
7373
are responsible for all document interactions such as create, read, update, and
@@ -158,11 +158,15 @@ folder/file. Open this file and add the following code:
158158
:language: javascript
159159
:dedent:
160160

161+
Perform CRUD Operations
162+
-----------------------
163+
161164
You now have your first model and schema set up, and you can start inserting
162-
data into the database.
165+
data into the database. The following sections show you how to perform CRUD
166+
operations using Mongoose.
163167

164168
Insert Data
165-
-----------
169+
~~~~~~~~~~~
166170

167171
Go to ``index.js`` and add the following import statement to the top of your file:
168172

@@ -216,7 +220,7 @@ To run the code, use the following command in your terminal:
216220
insert multiple articles into your database.
217221

218222
Update Data
219-
-----------
223+
~~~~~~~~~~~
220224

221225
To update data, you can directly edit the local object with Mongoose. Then, you
222226
can use the ``save()`` method to write the update to the database. Add the
@@ -246,7 +250,7 @@ following code to update the article you inserted in the previous section:
246250
}
247251

248252
Find Data
249-
---------
253+
~~~~~~~~~
250254

251255
To update a specific document, you can use the Mongoose ``findById()`` method to get
252256
a document by its ``ObjectId``.
@@ -285,7 +289,7 @@ value for the document that you inserted previously:
285289
see the `Promises guide <https://mongoosejs.com/docs/promises.html>`__ in the Mongoose documentation.
286290

287291
Specify Document Fields
288-
-----------------------
292+
~~~~~~~~~~~~~~~~~~~~~~~
289293

290294
Like with the {+driver-short+}, you can use Mongoose to project only the fields that
291295
you need. The following code specifies to only project the ``title``, ``slug``, and
@@ -315,7 +319,7 @@ previously:
315319
}
316320

317321
Delete Data
318-
-----------
322+
~~~~~~~~~~~
319323

320324
Mongoose uses the ``deleteOne()`` and ``deleteMany()`` methods to delete data from a
321325
collection. You can specify the field of the document you want to delete and
@@ -621,7 +625,7 @@ update the title, and then save the updated article:
621625
updated: 2025-05-15T18:18:30.249Z
622626
}
623627

624-
When this runs, the returned article includes an ``updated`` date.
628+
When you run the application, the returned article includes an ``updated`` date.
625629

626630
Besides the ``pre()`` middleware function, Mongoose also offers a ``post()``
627631
middleware function.

0 commit comments

Comments
 (0)