mongoose 9.0.0-rc0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ Mongoose is a [MongoDB](https://www.mongodb.org/) object modeling tool designed
13
13
 
14
14
  The official documentation website is [mongoosejs.com](http://mongoosejs.com/).
15
15
 
16
- Mongoose 8.0.0 was released on October 31, 2023. You can find more details on [backwards breaking changes in 8.0.0 on our docs site](https://mongoosejs.com/docs/migrating_to_8.html).
16
+ Mongoose 9.0.0 was released on November 21, 2025. You can find more details on [backwards breaking changes in 9.0.0 on our docs site](https://mongoosejs.com/docs/migrating_to_9.html).
17
17
 
18
18
  ## Support
19
19
 
@@ -58,7 +58,7 @@ module.exports = function getSchemaTypes(model, schema, doc, path) {
58
58
  continue;
59
59
  }
60
60
 
61
- if (foundschema.embeddedSchemaType) {
61
+ if (foundschema.embeddedSchemaType || foundschema.schema) {
62
62
  // array of Mixed?
63
63
  if (foundschema.embeddedSchemaType instanceof Mixed) {
64
64
  return foundschema.embeddedSchemaType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mongoose",
3
3
  "description": "Mongoose MongoDB ODM",
4
- "version": "9.0.0-rc0",
4
+ "version": "9.0.0",
5
5
  "author": "Guillermo Rauch <guillermo@learnboost.com>",
6
6
  "keywords": [
7
7
  "mongodb",
@@ -46,7 +46,7 @@
46
46
  "lodash.isequal": "4.5.0",
47
47
  "lodash.isequalwith": "4.4.0",
48
48
  "markdownlint-cli2": "^0.18.1",
49
- "marked": "16.4.1",
49
+ "marked": "15.x",
50
50
  "mkdirp": "^3.0.1",
51
51
  "mocha": "11.7.4",
52
52
  "moment": "2.30.1",
@@ -81,6 +81,7 @@
81
81
  "docs:prepare:publish:5x": "git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x",
82
82
  "docs:prepare:publish:6x": "git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x",
83
83
  "docs:prepare:publish:7x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/7.x && mv ./tmp ./docs/7.x",
84
+ "docs:prepare:publish:8x": "git checkout gh-pages && git merge 8.x && npm run docs:generate",
84
85
  "docs:check-links": "blc http://127.0.0.1:8089 -ro",
85
86
  "lint": "eslint .",
86
87
  "lint-js": "eslint . --ext .js --ext .cjs",
package/types/models.d.ts CHANGED
@@ -1016,7 +1016,7 @@ declare module 'mongoose' {
1016
1016
  recompileSchema(): void;
1017
1017
 
1018
1018
  /** Schema the model uses. */
1019
- schema: Schema<TRawDocType>;
1019
+ schema: TSchema;
1020
1020
 
1021
1021
  /** Creates a `updateMany` query: updates all documents that match `filter` with `update`. */
1022
1022
  updateMany(
@@ -2,7 +2,7 @@ declare module 'mongoose' {
2
2
  type IfAny<IFTYPE, THENTYPE, ELSETYPE = IFTYPE> = 0 extends 1 & IFTYPE
3
3
  ? THENTYPE
4
4
  : ELSETYPE;
5
- type IfUnknown<IFTYPE, THENTYPE> = unknown extends IFTYPE ? THENTYPE : IFTYPE;
5
+ type IsUnknown<T> = unknown extends T ? true : false;
6
6
 
7
7
  type IsNotNever<T> = [T] extends [never] ? false : true;
8
8
  type IsAny<T> = 0 extends 1 & T ? true : false;
@@ -155,7 +155,7 @@ declare module 'mongoose' {
155
155
  */
156
156
  type AddThisParameter<T, D> = {
157
157
  [K in keyof T]: T[K] extends (...args: infer A) => infer R
158
- ? ThisParameter<T[K], unknown> extends unknown
158
+ ? IsUnknown<ThisParameter<T[K], unknown>> extends true
159
159
  ? (this: D, ...args: A) => R
160
160
  : T[K]
161
161
  : T[K];