Skip to content

Commit 7b87977

Browse files
authored
Merge branch '9.0' into codex/remove-nolistener-option-from-code
2 parents a3e4c88 + cbb5d10 commit 7b87977

File tree

197 files changed

+2912
-6077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+2912
-6077
lines changed

.eslintrc.js

Lines changed: 0 additions & 204 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
node: [16, 18, 20, 22, 24]
42+
node: [18, 20, 22, 24]
4343
os: [ubuntu-22.04, ubuntu-24.04]
4444
mongodb: [6.0.15, 7.0.12, 8.0.0]
4545
include:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
8.18.2 / 2025-09-22
2+
===================
3+
* fix(document): prevent $clone() from converting mongoose arrays into vanilla arrays #15633 #15625
4+
* fix(connection): use correct collection name for model when using useConnection() #15637
5+
* fix(connection): propagate changes to _lastHeartbeatAt to useDb() child connections #15640 #15635
6+
* types: fix schema property type definition in SchemaType #15631
7+
18
8.18.1 / 2025-09-08
29
===================
310
* types: correct type inference for maps of maps #15602

browser.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/browser.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,4 @@
11
# Mongoose in the Browser
22

3-
Mongoose supports creating schemas and validating documents in the browser.
4-
Mongoose's browser library does **not** support saving documents, [queries](http://mongoosejs.com/docs/queries.html), [populate](http://mongoosejs.com/docs/populate.html), [discriminators](http://mongoosejs.com/docs/discriminators.html), or any other Mongoose feature other than schemas and validating documents.
5-
6-
Mongoose has a pre-built bundle of the browser library. If you're bundling your code with [Webpack](https://webpack.js.org/), you should be able to import Mongoose's browser library as shown below if your Webpack `target` is `'web'`:
7-
8-
```javascript
9-
import mongoose from 'mongoose';
10-
```
11-
12-
You can use the below syntax to access the Mongoose browser library from Node.js:
13-
14-
```javascript
15-
// Using `require()`
16-
const mongoose = require('mongoose/browser');
17-
18-
// Using ES6 imports
19-
import mongoose from 'mongoose/browser';
20-
```
21-
22-
## Using the Browser Library {#usage}
23-
24-
Mongoose's browser library is very limited. The only use case it supports is validating documents as shown below.
25-
26-
```javascript
27-
import mongoose from 'mongoose';
28-
29-
// Mongoose's browser library does **not** have models. It only supports
30-
// schemas and documents. The primary use case is validating documents
31-
// against Mongoose schemas.
32-
const doc = new mongoose.Document({}, new mongoose.Schema({
33-
name: { type: String, required: true }
34-
}));
35-
// Prints an error because `name` is required.
36-
console.log(doc.validateSync());
37-
```
3+
As of Mongoose 9, [Mongoose's browser build is now in the `@mongoosejs/browser` npm package](https://github.com/mongoosejs/mongoose-browser).
4+
The documentation has been moved to the [`@mongoosejs/browser` README](https://github.com/mongoosejs/mongoose-browser?tab=readme-ov-file#mongoosejsbrowser).

docs/compatibility.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,13 @@ Below are the [semver](http://semver.org/) ranges representing which versions of
1818

1919
| MongoDB Server | Mongoose |
2020
| :------------: | :--------------------------------------------: |
21-
| `8.x` | `^8.7.0` |
22-
| `7.x` | `^7.4.0 \| ^8.0.0` |
23-
| `6.x` | `^6.5.0 \| ^7.0.0 \| ^8.0.0` |
24-
| `5.x` | `^5.13.0` \| `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
25-
| `4.4.x` | `^5.10.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0` |
26-
| `4.2.x` | `^5.7.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0` |
27-
| `4.0.x` | `^5.2.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.16.0` |
28-
| `3.6.x` | `^5.0.0 \| ^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.8.0` |
29-
| `3.4.x` | `^4.7.3 \| ^5.0.0` |
30-
| `3.2.x` | `^4.3.0 \| ^5.0.0` |
31-
| `3.0.x` | `^3.8.22 \| ^4.0.0 \| ^5.0.0` |
32-
| `2.6.x` | `^3.8.8 \| ^4.0.0 \| ^5.0.0` |
33-
| `2.4.x` | `^3.8.0 \| ^4.0.0` |
21+
| `8.x` | `^8.7.0 | ^9.0.0` |
22+
| `7.x` | `^7.4.0 \| ^8.0.0 \| ^9.0.0` |
23+
| `6.x` | `^7.0.0 \| ^8.0.0 \| ^9.0.0` |
24+
| `5.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
25+
| `4.4.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
26+
| `4.2.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0` |
27+
| `4.0.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.16.0` |
28+
| `3.6.x` | `^6.0.0 \| ^7.0.0 \| ^8.0.0 <8.8.0` |
3429

3530
Mongoose `^6.5.0` also works with MongoDB server 7.x. But not all new MongoDB server 7.x features are supported by Mongoose 6.x.
36-
37-
Note that Mongoose `5.x` dropped support for all versions of MongoDB before `3.0.0`. If you need to use MongoDB `2.6` or older, use Mongoose `4.x`.

0 commit comments

Comments
 (0)