Skip to content

Commit 19309fe

Browse files
authored
Merge branch '8.9' into NODE-6504/double
2 parents b467e69 + 6d8a0f2 commit 19309fe

Some content is hidden

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

56 files changed

+2276
-384
lines changed

.github/workflows/benchmark.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
runs-on: ubuntu-20.04
2323
name: Benchmark TypeScript Types
2424
steps:
25-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
with:
2727
fetch-depth: 0
2828
- name: Setup node
29-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
29+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3030
with:
31-
node-version: 16
31+
node-version: 22
3232

3333
- run: npm install
3434

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525

2626
# Initializes the CodeQL tools for scanning.
2727
- name: Initialize CodeQL

.github/workflows/documentation.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
runs-on: ubuntu-latest
2929
name: Lint Markdown files
3030
steps:
31-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
31+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3232

3333
- name: Setup node
34-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
34+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
3535
with:
36-
node-version: 20
36+
node-version: 22
3737

3838
- run: npm install
3939

@@ -48,13 +48,13 @@ jobs:
4848
runs-on: ubuntu-20.04
4949
name: Test Generating Docs
5050
steps:
51-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
51+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5252
- run: git fetch --depth=1 --tags # download all tags for documentation
5353

5454
- name: Setup node
55-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
55+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
5656
with:
57-
node-version: 20
57+
node-version: 22
5858

5959
- run: npm install
6060
- name: Setup MongoDB

.github/workflows/test.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
runs-on: ubuntu-latest
2323
name: Lint JS-Files
2424
steps:
25-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626

2727
- name: Setup node
28-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
28+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
2929
with:
30-
node-version: 18
30+
node-version: 22
3131

3232
- run: npm install
3333

@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
node: [16, 18, 20]
42+
node: [16, 18, 20, 22]
4343
os: [ubuntu-20.04, ubuntu-22.04]
4444
mongodb: [4.4.29, 5.0.26, 6.0.15, 7.0.12, 8.0.0]
4545
include:
@@ -58,10 +58,10 @@ jobs:
5858
MONGOMS_PREFER_GLOBAL_PATH: 1
5959
FORCE_COLOR: true
6060
steps:
61-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
61+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6262

6363
- name: Setup node
64-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
64+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
6565
with:
6666
node-version: ${{ matrix.node }}
6767

@@ -94,19 +94,19 @@ jobs:
9494
MONGOMS_PREFER_GLOBAL_PATH: 1
9595
FORCE_COLOR: true
9696
steps:
97-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
97+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9898
- name: Setup node
99-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
99+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
100100
with:
101-
node-version: 16
101+
node-version: 22
102102
- name: Load MongoDB binary cache
103103
id: cache-mongodb-binaries
104104
uses: actions/cache@v4
105105
with:
106106
path: ~/.cache/mongodb-binaries
107107
key: deno-${{ env.MONGOMS_VERSION }}
108108
- name: Setup Deno
109-
uses: denoland/setup-deno@v1
109+
uses: denoland/setup-deno@v2
110110
with:
111111
deno-version: v1.37.x
112112
- run: deno --version
@@ -122,11 +122,11 @@ jobs:
122122
env:
123123
FORCE_COLOR: true
124124
steps:
125-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
125+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126126
- name: Setup node
127-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
127+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
128128
with:
129-
node-version: 16
129+
node-version: 22
130130
- run: npm install
131131
- name: Test
132132
run: npm run test-rs
@@ -139,6 +139,6 @@ jobs:
139139
contents: read
140140
steps:
141141
- name: Check out repo
142-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
142+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
143143
- name: Dependency review
144144
uses: actions/dependency-review-action@v4

.github/workflows/tidelift-alignment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
if: github.repository == 'Automattic/mongoose'
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1919
- name: Setup node
20-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
20+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
2121
with:
22-
node-version: 16
22+
node-version: 22
2323
- name: Alignment
2424
uses: tidelift/alignment-action@8d7700fe795fc01179c1f9fa05b72a089873027d # main
2525
env:

.github/workflows/tsd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
runs-on: ubuntu-latest
2121
name: Lint TS-Files
2222
steps:
23-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424

2525
- name: Setup node
26-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
26+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
2727
with:
28-
node-version: 18
28+
node-version: 22
2929

3030
- run: npm install
3131

@@ -38,12 +38,12 @@ jobs:
3838
runs-on: ubuntu-latest
3939
name: Test Typescript Types
4040
steps:
41-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
41+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4242

4343
- name: Setup node
44-
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
44+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
4545
with:
46-
node-version: 16
46+
node-version: 22
4747

4848
- run: npm install
4949

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
8.8.4 / 2024-12-05
2+
==================
3+
* fix: cast using overwritten embedded discriminator key when set #15076 #15051
4+
* fix: avoid throwing error if saveOptions undefined when invalidating subdoc cache #15062
5+
6+
8.8.3 / 2024-11-26
7+
==================
8+
* fix: disallow using $where in match
9+
* perf: cache results from getAllSubdocs() on saveOptions, only loop through known subdoc properties #15055 #15029
10+
* fix(model+query): support overwriteDiscriminatorKey for bulkWrite updateOne and updateMany, allow inferring discriminator key from update #15046 #15040
11+
12+
8.8.2 / 2024-11-18
13+
==================
14+
* fix(model): handle array filters when casting bulkWrite #15036 #14978
15+
* fix(model): make diffIndexes() avoid trying to drop default timeseries collection index #15035 #14984
16+
* fix: save execution stack in query as string #15039 [durran](https://github.com/durran)
17+
* types(cursor): correct asyncIterator and asyncDispose for TypeScript with lib: 'esnext' #15038
18+
* docs(migrating_to_8): add note about removing findByIdAndRemove #15024 [dragontaek-lee](https://github.com/dragontaek-lee)
19+
20+
8.8.1 / 2024-11-08
21+
==================
22+
* perf: make a few micro-optimizations to help speed up findOne() #15022 #14906
23+
* fix: apply embedded discriminators to subdoc schemas before compiling top level model so middleware applies correctly #15001 #14961
24+
* fix(query): add overwriteImmutable option to allow updating immutable properties without disabling strict mode #15000 #8619
25+
126
8.8.0 / 2024-10-31
227
==================
328
* feat: upgrade mongodb -> ~6.10 #14991 #14877

benchmarks/saveSimple.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
'use strict';
2+
3+
const mongoose = require('../');
4+
5+
run().catch(err => {
6+
console.error(err);
7+
process.exit(-1);
8+
});
9+
10+
async function run() {
11+
await mongoose.connect('mongodb://127.0.0.1:27017/mongoose_benchmark');
12+
const FooSchema = new mongoose.Schema({
13+
prop1: String,
14+
prop2: String,
15+
prop3: String,
16+
prop4: String,
17+
prop5: String,
18+
prop6: String,
19+
prop7: String,
20+
prop8: String,
21+
prop9: String,
22+
prop10: String
23+
});
24+
const FooModel = mongoose.model('Foo', FooSchema);
25+
26+
if (!process.env.MONGOOSE_BENCHMARK_SKIP_SETUP) {
27+
await FooModel.deleteMany({});
28+
}
29+
30+
const numIterations = 500;
31+
const saveStart = Date.now();
32+
for (let i = 0; i < numIterations; ++i) {
33+
for (let j = 0; j < 10; ++j) {
34+
const doc = new FooModel({
35+
prop1: `test ${i}`,
36+
prop2: `test ${i}`,
37+
prop3: `test ${i}`,
38+
prop4: `test ${i}`,
39+
prop5: `test ${i}`,
40+
prop6: `test ${i}`,
41+
prop7: `test ${i}`,
42+
prop8: `test ${i}`,
43+
prop9: `test ${i}`,
44+
prop10: `test ${i}`
45+
});
46+
await doc.save();
47+
}
48+
}
49+
const saveEnd = Date.now();
50+
51+
const results = {
52+
'Average save time ms': +((saveEnd - saveStart) / numIterations).toFixed(2)
53+
};
54+
55+
console.log(JSON.stringify(results, null, ' '));
56+
process.exit(0);
57+
}

docs/guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ The permitted SchemaTypes are:
8181
* [Map](schematypes.html#maps)
8282
* [UUID](schematypes.html#uuid)
8383
* [Double](schematypes.html#double)
84+
* [Int32](schematypes.html#int32)
8485

8586
Read more about [SchemaTypes here](schematypes.html).
8687

docs/migrating_to_8.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ In Mongoose 7, `findOneAndRemove()` was an alias for `findOneAndDelete()` that M
8787
Mongoose 8 no longer supports `findOneAndRemove()`.
8888
Use `findOneAndDelete()` instead.
8989

90+
Similarly, Mongoose 8 no longer supports `findByIdAndRemove()`, which was an alias for `findByIdAndDelete()`.
91+
Please use `findByIdAndDelete()` instead.
92+
9093
## Removed `count()` {#removed-count}
9194

9295
`Model.count()` and `Query.prototype.count()` were removed in Mongoose 8. Use `Model.countDocuments()` and `Query.prototype.countDocuments()` instead.

0 commit comments

Comments
 (0)