Skip to content

Commit a860270

Browse files
committed
Merge branch 'master' into vkarpov15/gh-14719
2 parents 517f27b + c4c932a commit a860270

33 files changed

+1213
-428
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
8.5.0 / 2024-07-08
2+
==================
3+
* perf: memoize toJSON / toObject default options #14672
4+
* feat(document): add $createModifiedPathsSnapshot(), $restoreModifiedPathsSnapshot(), $clearModifiedPaths() #14699 #14268
5+
* feat(query): make sanitizeProjection prevent projecting in paths deselected in the schema #14691
6+
* feat: allow setting array default value to null #14717 #6691
7+
* feat(mongoose): allow drivers to set global plugins #14682
8+
* feat(connection): bubble up monitorCommands events to Mongoose connection if monitorCommands option set #14681 #14611
9+
* fix(document): ensure post('deleteOne') hooks are called when calling save() after subdoc.deleteOne() #14732 #9885
10+
* fix(query): remove count() and findOneAndRemove() from query chaining #14692 #14689
11+
* fix: remove default connection if setting createInitialConnection to false after Mongoose instance created #14679 #8302
12+
* types(models+query): infer return type from schema for 1-level deep nested paths #14632
13+
* types(connection): make transaction() return type match the executor function #14661 #14656
14+
* docs: fix docs links in index.md [mirasayon](https://github.com/mirasayon)
15+
116
8.4.5 / 2024-07-05
217
==================
318
* types: correct this for validate.validator schematype option #14720 #14696

docs/faq.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ const Kitten = connection.model('Kitten', kittySchema);
314314

315315
<a class="anchor" href="#array-defaults">**Q**</a>. How can I change mongoose's default behavior of initializing an array path to an empty array so that I can require real data on document creation?
316316

317-
**A**. You can set the default of the array to a function that returns `undefined`.
317+
**A**. You can set the default of the array to `undefined`.
318318

319319
```javascript
320320
const CollectionSchema = new Schema({
@@ -329,13 +329,13 @@ const CollectionSchema = new Schema({
329329

330330
<a class="anchor" href="#initialize-array-path-null">**Q**</a>. How can I initialize an array path to `null`?
331331

332-
**A**. You can set the default of the array to a function that returns `null`.
332+
**A**. You can set the default of the array to [`null`](https://masteringjs.io/tutorials/fundamentals/null).
333333

334334
```javascript
335335
const CollectionSchema = new Schema({
336336
field1: {
337337
type: [String],
338-
default: () => { return null; }
338+
default: null
339339
}
340340
});
341341
```

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
</style>
1414

15-
*First be sure you have [MongoDB](http://www.mongodb.org/downloads) and [Node.js](http://nodejs.org/) installed.*
15+
*First be sure you have [MongoDB](https://www.mongodb.com/try/download/community) and [Node.js](http://nodejs.org/en/download) installed.*
1616

1717
Next install Mongoose from the command line using `npm`:
1818

0 commit comments

Comments
 (0)