Skip to content

Commit 9ca46d1

Browse files
committedNov 14, 2022
docs: backport static links to relative
re #12690
1 parent 1a2d7f8 commit 9ca46d1

7 files changed

+15
-15
lines changed
 

‎docs/deprecations.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ behavior until Mongoose 6.0.
101101

102102
<h2 id="ensureindex"><a href="#ensureindex"><code>ensureIndex()</code></a></h2>
103103

104-
If you define [indexes in your Mongoose schemas](https://mongoosejs.com/docs/guide.html#indexes), you'll see the below
104+
If you define [indexes in your Mongoose schemas](guide.html#indexes), you'll see the below
105105
deprecation warning.
106106

107107
```
@@ -290,4 +290,4 @@ const writeStream = gfs.createWriteStream({ filename: 'test.dat' });
290290
const conn = mongoose.createConnection('mongodb://localhost:27017/gfstest');
291291
const gridFSBucket = new mongoose.mongo.GridFSBucket(conn.db);
292292
const writeStream = gridFSBucket.openUploadStream('test.dat');
293-
```
293+
```

‎docs/jest.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you choose to delve into dangerous waters and test Mongoose apps with Jest, h
88

99
<h2 id="recommended-testenvironment"><a href="#recommended-testenvironment">Recommended <code>testEnvironment</code></a></h2>
1010

11-
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.
11+
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.
1212

1313
The `jsdom` test environment attempts to create a browser-like test
1414
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](
8181

8282
<a href="https://pluralsight.pxf.io/c/1321469/424552/7490?u=https%3A%2F%2Fapp.pluralsight.com%2Flibrary%2Fcourses%2Fnode-js-express-rest-web-services%2Ftable-of-contents">
8383
<img src="https://i.imgur.com/KouuaAZ.png">
84-
</a>
84+
</a>

‎docs/promises.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This means that you can do things like `MyModel.findOne({}).then()` and
77
`await MyModel.findOne({}).exec()` if you're using
88
[async/await](http://thecodebarbarian.com/80-20-guide-to-async-await-in-node.js.html).
99

10-
You can find the return type of specific operations [in the api docs](https://mongoosejs.com/docs/api.html)
10+
You can find the return type of specific operations [in the api docs](api.html)
1111
You can also read more about [promises in Mongoose](https://masteringjs.io/tutorials/mongoose/promise).
1212

1313
```javascript
@@ -72,4 +72,4 @@ ES6-style promise constructor and mongoose will use it.
7272
<br><br>
7373
<a href="http://asyncawait.net/?utm_source=mongoosejs&utm_campaign=promises" style="margin-left: 100px">
7474
<img src="/docs/images/asyncawait.png" style="width: 650px" />
75-
</a>
75+
</a>

‎docs/queries.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ of inactivity. You can read more about working around session idle timeouts in t
200200

201201
<h3 id="versus-aggregation"><a href="#versus-aggregation">Versus Aggregation</a></h3>
202202

203-
[Aggregation](https://mongoosejs.com/docs/api.html#aggregate_Aggregate) can
203+
[Aggregation](api.html#aggregate_Aggregate) can
204204
do many of the same things that queries can. For example, below is
205205
how you can use `aggregate()` to find docs where `name.last = 'Ghost'`:
206206

‎docs/tutorials/custom-casting.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Custom Casting
22

3-
[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.
3+
[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.
44

55
For example, by default Mongoose will throw an error if you attempt to cast
66
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.
1414

1515
```javascript
1616
[require:custom casting.*casting override]
17-
```
17+
```

‎docs/tutorials/getters-setters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ app.get(function(req, res) {
2626
});
2727
```
2828

29-
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.
29+
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.
3030

3131
```javascript
3232
const userSchema = new Schema({
@@ -80,4 +80,4 @@ corresponding getter for `email`.
8080

8181
```javascript
8282
[require:getters/setters.*setters.*vs ES6]
83-
```
83+
```

‎docs/tutorials/query_casting.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Query Casting
22

3-
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:
3+
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:
44

55
```javascript
66
[require:Cast Tutorial.*get and set]
77
```
88

9-
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.
9+
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.
1010

1111
```javascript
1212
[require:Cast Tutorial.*cast values]
@@ -27,7 +27,7 @@ By default, Mongoose does **not** cast filter properties that aren't in your sch
2727
[require:Cast Tutorial.*not in schema]
2828
```
2929

30-
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:
30+
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:
3131

3232
```javascript
3333
[require:Cast Tutorial.*strictQuery true]
@@ -46,4 +46,4 @@ Because of schemas, Mongoose knows what types fields should be, so it can provid
4646

4747
```javascript
4848
[require:Cast Tutorial.*implicit in]
49-
```
49+
```

0 commit comments

Comments
 (0)
Please sign in to comment.