You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migrating_to_8.md
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ If you're still on Mongoose 6.x or earlier, please read the [Mongoose 6.x to 7.x
25
25
*[`create()` waits until all saves are done before throwing any error](#create-waits-until-all-saves-are-done-before-throwing-any-error)
26
26
*[`Model.validate()` returns copy of object](#model-validate-returns-copy-of-object)
27
27
*[Allow `null` For Optional Fields in TypeScript](#allow-null-for-optional-fields-in-typescript)
28
+
*[Model constructor properties are all optional in TypeScript](#model-constructor-properties-are-all-optional-in-typescript)
28
29
*[Infer `distinct()` return types from schema](#infer-distinct-return-types-from-schema)
29
30
30
31
<h2id="removed-rawresult-option-for-findoneandupdate"><ahref="#removed-rawresult-option-for-findoneandupdate">Removed <code>rawResult</code> option for <code>findOneAndUpdate()</code></a></h2>
@@ -247,6 +248,39 @@ const doc = new TestModel();
247
248
doc.name;
248
249
```
249
250
251
+
<h2id="model-constructor-properties-are-all-optional-in-typescript"><ahref="#model-constructor-properties-are-all-optional-in-typescript">Model constructor properties are all optional in TypeScript</a></h2>
252
+
253
+
In Mongoose 8, no properties are required on model constructors by default.
0 commit comments