Skip to content

Commit 42a7b5e

Browse files
Merge branch 'master' into NODE-6505/ci-setup
2 parents da6d7e1 + 5af0a10 commit 42a7b5e

File tree

96 files changed

+4654
-882
lines changed

Some content is hidden

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

96 files changed

+4654
-882
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: 117 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,113 @@
1+
8.9.5 / 2025-01-13
2+
==================
3+
* fix: disallow nested $where in populate match
4+
* fix(schema): handle bitwise operators on Int32 #15176 #15170
5+
6+
7.8.4 / 2025-01-13
7+
===================
8+
* fix: disallow nested $where in populate match
9+
10+
6.13.6 / 2025-01-13
11+
===================
12+
* fix: disallow nested $where in populate match
13+
14+
8.9.4 / 2025-01-09
15+
==================
16+
* fix(document): fix document not applying manual populate when using a function in schema.options.ref #15138 [IchirokuXVI](https://github.com/IchirokuXVI)
17+
* fix(model): make Model.validate() static correctly cast document arrays #15169 #15164
18+
* fix(model): allow passing validateBeforeSave option to bulkSave() to skip validation #15161 #15156
19+
* fix(schema): allow multiple self-referencing discriminator schemas using Schema.prototype.discriminator #15142 #15120
20+
* types: avoid BufferToBinary<> wiping lean types when passed to generic functions #15160 #15158
21+
* docs: fix `<code>` in header ids #15159
22+
* docs: fix header in field-level-encryption.md #15137 [damieng](https://github.com/damieng)
23+
24+
8.9.3 / 2024-12-30
25+
==================
26+
* fix(schema): make duplicate index error a warning for now to prevent blocking upgrading #15135 #15112 #15109
27+
* fix(model): handle document array paths set to non-array values in Model.castObject() #15124 #15075
28+
* fix(document): avoid using childSchemas.path for compatibility with pre-Mongoose-8.8 schemas #15131 #15071
29+
* fix(model): avoid throwing unnecessary error if updateOne() returns null in save() #15126
30+
* perf(cursor): clear the stack every time if using populate with batchSize to avoid stack overflows with large docs #15136 #10449
31+
* types: make BufferToBinary avoid Document instances #15123 #15122
32+
* types(model+query): avoid stripping out virtuals when calling populate with paths generic #15132 #15111
33+
* types(schema): add missing removeIndex #15134
34+
* types: add cleanIndexes() to IndexManager interface #15127
35+
* docs: move search endpoint to netlify #15119
36+
37+
8.9.2 / 2024-12-19
38+
==================
39+
* fix(schema): avoid throwing duplicate index error if index spec keys have different order or index has a custom name #15112 #15109
40+
* fix(map): clean modified subpaths when overwriting values in map of subdocs #15114 #15108
41+
* fix(aggregate): pull session from transaction local storage for aggregation cursors #15094 [IchirokuXVI](https://github.com/IchirokuXVI)
42+
* types: correctly handle union types in BufferToBinary and related helpers #15103 #15102 #15057
43+
* types: add UUID to RefType #15115 #15101
44+
* docs: remove link to Mongoose 5.x docs from dropdown #15116
45+
* docs(connection+document+model): remove remaining references to remove(), clarify that deleteOne() does not execute until then() or exec() #15113 #15107
46+
47+
8.9.1 / 2024-12-16
48+
==================
49+
* fix(connection): remove heartbeat check in load balanced mode #15089 #15042 #14812
50+
* fix(discriminator): gather childSchemas when creating discriminator to ensure $getAllSubdocs() can properly get all subdocs #15099 #15088 #15092
51+
* fix(model): handle discriminators in castObject() #15096 #15075
52+
* fix(schema): throw error if duplicate index definition using unique in schema path and subsequent .index() call #15093 #15056
53+
* fix: mark documents that are populated using hydratedPopulatedDocs option as populated in top-level doc #15080 #15048
54+
* fix(document+schema): improve error message for get() on invalid path #15098 #15071
55+
* docs: remove more callback doc references & some small other changes #15095
56+
57+
8.9.0 / 2024-12-13
58+
==================
59+
* feat: upgrade mongodb -> 6.12
60+
* feat: add int32 schematype #15054 [aditi-khare-mongoDB](https://github.com/aditi-khare-mongoDB)
61+
* feat: add double schematype #15061 [aditi-khare-mongoDB](https://github.com/aditi-khare-mongoDB)
62+
* feat: allow specifying error message override for duplicate key errors unique: true #15059 #12844
63+
* feat(connection): add support for Connection.prototype.bulkWrite() with MongoDB server 8.0 #15058 #15028
64+
* feat: add forceRepopulate option for populate() to allow avoiding repopulating already populated docs #15044 #14979
65+
* fix(connection): remove heartbeat check in load balanced mode #15089 #15042
66+
* fix(query): clone PopulateOptions when setting _localModel to avoid state leaking between subpopulate instances #15082 #15026
67+
* types: add splice() to DocumentArray to allow adding partial objects with splice() #15085 #15041
68+
* types(aggregate): add $firstN, $lastN, $bottom, $bottomN, $minN and $maxN operators #15087 [mlomnicki](https://github.com/mlomnicki)
69+
* docs: Remove merge conflict markers #15090 [sponrad](https://github.com/sponrad)
70+
71+
8.8.4 / 2024-12-05
72+
==================
73+
* fix: cast using overwritten embedded discriminator key when set #15076 #15051
74+
* fix: avoid throwing error if saveOptions undefined when invalidating subdoc cache #15062
75+
76+
8.8.3 / 2024-11-26
77+
==================
78+
* fix: disallow using $where in match
79+
* perf: cache results from getAllSubdocs() on saveOptions, only loop through known subdoc properties #15055 #15029
80+
* fix(model+query): support overwriteDiscriminatorKey for bulkWrite updateOne and updateMany, allow inferring discriminator key from update #15046 #15040
81+
82+
7.8.3 / 2024-11-26
83+
==================
84+
* fix: disallow using $where in match
85+
* fix(projection): avoid setting projection to unknown exclusive/inclusive if elemMatch on a Date, ObjectId, etc. #14894 #14893
86+
* docs(migrating_to_7): add note about keepAlive to Mongoose 7 migration guide #15032 #13431
87+
88+
6.13.5 / 2024-11-26
89+
===================
90+
* fix: disallow using $where in match
91+
92+
8.8.2 / 2024-11-18
93+
==================
94+
* fix(model): handle array filters when casting bulkWrite #15036 #14978
95+
* fix(model): make diffIndexes() avoid trying to drop default timeseries collection index #15035 #14984
96+
* fix: save execution stack in query as string #15039 [durran](https://github.com/durran)
97+
* types(cursor): correct asyncIterator and asyncDispose for TypeScript with lib: 'esnext' #15038
98+
* docs(migrating_to_8): add note about removing findByIdAndRemove #15024 [dragontaek-lee](https://github.com/dragontaek-lee)
99+
100+
6.13.4 / 2024-11-15
101+
===================
102+
* fix: save execution stack in query as string #15043 #15039
103+
* docs: clarify strictQuery default will flip-flop in "Migrating to 6.x" #14998 [markstos](https://github.com/markstos)
104+
105+
8.8.1 / 2024-11-08
106+
==================
107+
* perf: make a few micro-optimizations to help speed up findOne() #15022 #14906
108+
* fix: apply embedded discriminators to subdoc schemas before compiling top level model so middleware applies correctly #15001 #14961
109+
* fix(query): add overwriteImmutable option to allow updating immutable properties without disabling strict mode #15000 #8619
110+
1111
8.8.0 / 2024-10-31
2112
==================
3113
* feat: upgrade mongodb -> ~6.10 #14991 #14877
@@ -13,7 +123,6 @@
13123
* types: use globalThis instead of global for NativeDate #14992 #14988
14124
* docs(change-streams): fix markdown syntax highlighting for script output example #14994
15125

16-
17126
8.7.3 / 2024-10-25
18127
==================
19128
* fix(cursor): close underlying query cursor when calling destroy() #14982 #14966
@@ -61,6 +170,10 @@
61170
==================
62171
* fix(projection): avoid setting projection to unknown exclusive/inclusive if elemMatch on a Date, ObjectId, etc. #14894 #14893
63172

173+
6.13.3 / 2024-09-23
174+
===================
175+
* docs(migrating_to_6): document that Lodash _.isEmpty() with ObjectId() as a parameter returns true in Mongoose 6 #11152
176+
64177
8.6.3 / 2024-09-17
65178
==================
66179
* fix: make getters convert uuid to string when calling toObject() and toJSON() #14890 #14869
@@ -181,7 +294,6 @@
181294
==================
182295
* feat(model): add throwOnValidationError option for opting into getting MongooseBulkWriteError if all valid operations succeed in bulkWrite() and insertMany() #14599 #14587 #14572 #13410
183296

184-
<<<<<<< HEAD
185297
8.4.3 / 2024-06-17
186298
==================
187299
* fix: remove 0x flamegraph files from release
@@ -194,11 +306,10 @@
194306
* fix(connection): fix up some inconsistencies in operation-end event and add to docs #14659 #14648
195307
* types: avoid inferring Boolean, Buffer, ObjectId as Date in schema definitions under certain circumstances #14667 #14630
196308
* docs: add note about parallelism in transations #14647 [fiws](https://github.com/fiws)
197-
=======
309+
198310
6.13.1 / 2024-09-06
199311
===================
200312
* fix: remove empty $and, $or, $not that were made empty by scrict mode #14749 #13086 [0x0a0d](https://github.com/0x0a0d)
201-
>>>>>>> 7.x
202313

203314
6.13.0 / 2024-06-06
204315
===================
@@ -1021,7 +1132,7 @@
10211132
* fix(document): isModified should not be triggered when setting a nested boolean to the same value as previously #12994 [lpizzinidev](https://github.com/lpizzinidev)
10221133
* fix(document): save newly set defaults underneath single nested subdocuments #13002 #12905
10231134
* fix(update): handle custom discriminator model name when casting update #12947 [wassil](https://github.com/wassil)
1024-
* fix(connection): handles unique autoincrement ID for connections #12990 [lpizzinidev](https://github.com/lpizzinidev)
1135+
* fix(connection): handles unique autoincrement ID for connections #12990 [lpizzinidev](https://github.com/lpizzinidev)
10251136
* fix(types): fix type of options of Model.aggregate #12933 [ghost91-](https://github.com/ghost91-)
10261137
* fix(types): fix "near" aggregation operator input type #12954 [Jokero](https://github.com/Jokero)
10271138
* fix(types): add missing Top operator to AccumulatorOperator type declaration #12952 [lpizzinidev](https://github.com/lpizzinidev)
@@ -1050,7 +1161,7 @@
10501161
* docs(typescript): add notes about virtual context to Mongoose 6 migration and TypeScript virtuals docs #12912 #12806
10511162
* docs(schematypes): removed dead link and fixed formatting #12897 #12885 [lpizzinidev](https://github.com/lpizzinidev)
10521163
* docs: fix link to lean api #12910 [manniL](https://github.com/manniL)
1053-
* docs: list all possible strings for schema.pre in one place #12868
1164+
* docs: list all possible strings for schema.pre in one place #12868
10541165
* docs: add list of known incompatible npm packages #12892 [IslandRhythms](https://github.com/IslandRhythms)
10551166

10561167
6.8.3 / 2023-01-06

0 commit comments

Comments
 (0)