diff --git a/docs/deprecations.md b/docs/deprecations.md
index b17953659c0..628c304fca1 100644
--- a/docs/deprecations.md
+++ b/docs/deprecations.md
@@ -101,7 +101,7 @@ behavior until Mongoose 6.0.
-If you define [indexes in your Mongoose schemas](https://mongoosejs.com/docs/guide.html#indexes), you'll see the below
+If you define [indexes in your Mongoose schemas](guide.html#indexes), you'll see the below
deprecation warning.
```
@@ -290,4 +290,4 @@ const writeStream = gfs.createWriteStream({ filename: 'test.dat' });
const conn = mongoose.createConnection('mongodb://localhost:27017/gfstest');
const gridFSBucket = new mongoose.mongo.GridFSBucket(conn.db);
const writeStream = gridFSBucket.openUploadStream('test.dat');
-```
\ No newline at end of file
+```
diff --git a/docs/jest.md b/docs/jest.md
index 36e07845d45..108ca6efcd0 100644
--- a/docs/jest.md
+++ b/docs/jest.md
@@ -8,7 +8,7 @@ If you choose to delve into dangerous waters and test Mongoose apps with Jest, h
-If you are using Jest `<=26`, do **not** use Jest's default [`jsdom` test environment](https://jestjs.io/docs/en/configuration.html#testenvironment-string) when testing Mongoose apps, _unless_ you are explicitly testing an application that only uses [Mongoose's browser library](https://mongoosejs.com/docs/browser.html). In Jest `>=27`, ["node" is Jest's default `testEnvironment`](https://jestjs.io/ro/blog/2021/05/25/jest-27#flipping-defaults), so this is no longer an issue.
+If you are using Jest `<=26`, do **not** use Jest's default [`jsdom` test environment](https://jestjs.io/docs/en/configuration.html#testenvironment-string) when testing Mongoose apps, _unless_ you are explicitly testing an application that only uses [Mongoose's browser library](browser.html). In Jest `>=27`, ["node" is Jest's default `testEnvironment`](https://jestjs.io/ro/blog/2021/05/25/jest-27#flipping-defaults), so this is no longer an issue.
The `jsdom` test environment attempts to create a browser-like test
environment in Node.js, and it comes with numerous nasty surprises like a
@@ -81,4 +81,4 @@ course on Pluralsight has a great section on testing Mongoose apps with [Mocha](
-
\ No newline at end of file
+
diff --git a/docs/promises.md b/docs/promises.md
index 562626890a3..cc86b1e602f 100644
--- a/docs/promises.md
+++ b/docs/promises.md
@@ -7,7 +7,7 @@ This means that you can do things like `MyModel.findOne({}).then()` and
`await MyModel.findOne({}).exec()` if you're using
[async/await](http://thecodebarbarian.com/80-20-guide-to-async-await-in-node.js.html).
-You can find the return type of specific operations [in the api docs](https://mongoosejs.com/docs/api.html)
+You can find the return type of specific operations [in the api docs](api.html)
You can also read more about [promises in Mongoose](https://masteringjs.io/tutorials/mongoose/promise).
```javascript
@@ -72,4 +72,4 @@ ES6-style promise constructor and mongoose will use it.
-
\ No newline at end of file
+
diff --git a/docs/queries.md b/docs/queries.md
index 501fe37068f..f1ee795559c 100644
--- a/docs/queries.md
+++ b/docs/queries.md
@@ -200,7 +200,7 @@ of inactivity. You can read more about working around session idle timeouts in t
-[Aggregation](https://mongoosejs.com/docs/api.html#aggregate_Aggregate) can
+[Aggregation](api.html#aggregate_Aggregate) can
do many of the same things that queries can. For example, below is
how you can use `aggregate()` to find docs where `name.last = 'Ghost'`:
diff --git a/docs/tutorials/custom-casting.md b/docs/tutorials/custom-casting.md
index 8a60dc2630b..9c1d12aac3a 100644
--- a/docs/tutorials/custom-casting.md
+++ b/docs/tutorials/custom-casting.md
@@ -1,6 +1,6 @@
# Custom Casting
-[Mongoose 5.4.0](https://github.com/Automattic/mongoose/blob/master/History.md#540--2018-12-14) introduced [several ways to configure SchemaTypes globally](http://thecodebarbarian.com/whats-new-in-mongoose-54-global-schematype-configuration). One of these new features is the [`SchemaType.cast()` function](https://mongoosejs.com/docs/api.html#schematype_SchemaType-cast), which enables you to override Mongoose's built-in casting.
+[Mongoose 5.4.0](https://github.com/Automattic/mongoose/blob/master/History.md#540--2018-12-14) introduced [several ways to configure SchemaTypes globally](http://thecodebarbarian.com/whats-new-in-mongoose-54-global-schematype-configuration). One of these new features is the [`SchemaType.cast()` function](../api.html#schematype_SchemaType-cast), which enables you to override Mongoose's built-in casting.
For example, by default Mongoose will throw an error if you attempt to cast
a string that contains a Japanese numeral to a number.
@@ -14,4 +14,4 @@ the string that contains the Japanese numeral "2" to a number as shown below.
```javascript
[require:custom casting.*casting override]
-```
\ No newline at end of file
+```
diff --git a/docs/tutorials/getters-setters.md b/docs/tutorials/getters-setters.md
index 044ca0ea406..c26606db0e1 100644
--- a/docs/tutorials/getters-setters.md
+++ b/docs/tutorials/getters-setters.md
@@ -26,7 +26,7 @@ app.get(function(req, res) {
});
```
-To disable running getters when converting a document to JSON, set the [`toJSON.getters` option to `false` in your schema](https://mongoosejs.com/docs/guide.html#toJSON) as shown below.
+To disable running getters when converting a document to JSON, set the [`toJSON.getters` option to `false` in your schema](../guide.html#toJSON) as shown below.
```javascript
const userSchema = new Schema({
@@ -80,4 +80,4 @@ corresponding getter for `email`.
```javascript
[require:getters/setters.*setters.*vs ES6]
-```
\ No newline at end of file
+```
diff --git a/docs/tutorials/query_casting.md b/docs/tutorials/query_casting.md
index 0ce03a09902..01c06c9a509 100644
--- a/docs/tutorials/query_casting.md
+++ b/docs/tutorials/query_casting.md
@@ -1,12 +1,12 @@
# Query Casting
-The first parameter to [`Model.find()`](https://mongoosejs.com/docs/api.html#model_Model.find), [`Query#find()`](https://mongoosejs.com/docs/api.html#query_Query-find), [`Model.findOne()`](https://mongoosejs.com/docs/api.html#model_Model.findOne), etc. is called `filter`. In older content this parameter is sometimes called `query` or `conditions`. For example:
+The first parameter to [`Model.find()`](../api.html#model_Model.find), [`Query#find()`](../api.html#query_Query-find), [`Model.findOne()`](../api.html#model_Model.findOne), etc. is called `filter`. In older content this parameter is sometimes called `query` or `conditions`. For example:
```javascript
[require:Cast Tutorial.*get and set]
```
-When you execute the query using [`Query#exec()`](https://mongoosejs.com/docs/api.html#query_Query-exec) or [`Query#then()`](https://mongoosejs.com/docs/api.html#query_Query-then), Mongoose _casts_ the filter to match your schema.
+When you execute the query using [`Query#exec()`](../api.html#query_Query-exec) or [`Query#then()`](../api.html#query_Query-then), Mongoose _casts_ the filter to match your schema.
```javascript
[require:Cast Tutorial.*cast values]
@@ -27,7 +27,7 @@ By default, Mongoose does **not** cast filter properties that aren't in your sch
[require:Cast Tutorial.*not in schema]
```
-You can configure this behavior using the [`strictQuery` option for schemas](https://mongoosejs.com/docs/guide.html#strictQuery). This option is analogous to the [`strict` option](https://mongoosejs.com/docs/guide.html#strict). Setting `strictQuery` to `true` removes non-schema properties from the filter:
+You can configure this behavior using the [`strictQuery` option for schemas](../guide.html#strictQuery). This option is analogous to the [`strict` option](../guide.html#strict). Setting `strictQuery` to `true` removes non-schema properties from the filter:
```javascript
[require:Cast Tutorial.*strictQuery true]
@@ -46,4 +46,4 @@ Because of schemas, Mongoose knows what types fields should be, so it can provid
```javascript
[require:Cast Tutorial.*implicit in]
-```
\ No newline at end of file
+```