Skip to content

Commit 2ecc7ed

Browse files
committed
Merge branch 'master' into vkarpov15/gh-14082
2 parents a8e5e73 + d655898 commit 2ecc7ed

File tree

158 files changed

+3553
-3302
lines changed

Some content is hidden

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

158 files changed

+3553
-3302
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ module.exports = {
2323
'**/*.md/*.ts',
2424
'**/*.md/*.typescript'
2525
],
26+
parserOptions: {
27+
project: './tsconfig.json'
28+
},
2629
extends: [
2730
'plugin:@typescript-eslint/eslint-recommended',
2831
'plugin:@typescript-eslint/recommended'

.github/workflows/benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
runs-on: ubuntu-20.04
2323
name: Benchmark TypeScript Types
2424
steps:
25-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626
with:
2727
fetch-depth: 0
2828
- name: Setup node
29-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
29+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
3030
with:
3131
node-version: 16
3232

.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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2525

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

.github/workflows/documentation.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
runs-on: ubuntu-latest
2929
name: Lint Markdown files
3030
steps:
31-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
31+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3232

3333
- name: Setup node
34-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
34+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
3535
with:
3636
node-version: 16
3737

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

5454
- name: Setup node
55-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
55+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
5656
with:
5757
node-version: 16
5858

.github/workflows/test.yml

Lines changed: 12 additions & 12 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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626

2727
- name: Setup node
28-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
28+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
2929
with:
30-
node-version: 14
30+
node-version: 18
3131

3232
- run: npm install
3333

@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
node: [14, 16, 18, 20]
42+
node: [16, 18, 20]
4343
os: [ubuntu-20.04, ubuntu-22.04]
4444
mongodb: [4.4.18, 5.0.14, 6.0.4]
4545
include:
@@ -58,10 +58,10 @@ jobs:
5858
MONGOMS_PREFER_GLOBAL_PATH: 1
5959
FORCE_COLOR: true
6060
steps:
61-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
61+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6262

6363
- name: Setup node
64-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
64+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
6565
with:
6666
node-version: ${{ matrix.node }}
6767

@@ -94,9 +94,9 @@ jobs:
9494
MONGOMS_PREFER_GLOBAL_PATH: 1
9595
FORCE_COLOR: true
9696
steps:
97-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
97+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
9898
- name: Setup node
99-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
99+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
100100
with:
101101
node-version: 16
102102
- name: Load MongoDB binary cache
@@ -108,7 +108,7 @@ jobs:
108108
- name: Setup Deno
109109
uses: denoland/setup-deno@v1
110110
with:
111-
deno-version: v1.34.x
111+
deno-version: v1.36.x
112112
- run: deno --version
113113
- run: npm install
114114
- name: Run Deno tests
@@ -122,9 +122,9 @@ jobs:
122122
env:
123123
FORCE_COLOR: true
124124
steps:
125-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
125+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
126126
- name: Setup node
127-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
127+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
128128
with:
129129
node-version: 16
130130
- run: npm install
@@ -139,6 +139,6 @@ jobs:
139139
contents: read
140140
steps:
141141
- name: Check out repo
142-
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
142+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
143143
- name: Dependency review
144144
uses: actions/dependency-review-action@v3

.github/workflows/tidelift-alignment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
if: github.repository == 'Automattic/mongoose'
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
18+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1919
- name: Setup node
20-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
20+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
2121
with:
2222
node-version: 16
2323
- name: Alignment

.github/workflows/tsd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
runs-on: ubuntu-latest
2323
name: Lint TS-Files
2424
steps:
25-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626

2727
- name: Setup node
28-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
28+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
2929
with:
30-
node-version: 14
30+
node-version: 18
3131

3232
- run: npm install
3333

@@ -40,10 +40,10 @@ jobs:
4040
runs-on: ubuntu-latest
4141
name: Test Typescript Types
4242
steps:
43-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
43+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4444

4545
- name: Setup node
46-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
46+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
4747
with:
4848
node-version: 14
4949

CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
8.0.3 / 2023-12-07
2+
==================
3+
* fix(schema): avoid creating unnecessary clone of schematype in nested array so nested document arrays use correct constructor #14128 #14101
4+
* docs(connections): add example of registering connection event handlers #14150
5+
* docs(populate): add example of using `refPath` and `ref` functions #14133 #13834
6+
* types: handle using BigInt global class in schema definitions #14160 #14147
7+
* types: make findOneAndDelete() without options return result doc, not ModifyResult #14153 #14130
8+
* types(model): add no-generic override for insertMany() with options #14152 #13999
9+
* types: add missing Type for applyDefaults #14159 [jaypea](https://github.com/jaypea)
10+
11+
7.6.7 / 2023-12-06
12+
==================
13+
* fix: avoid minimizing single nested subdocs if they are required #14151 #14058
14+
* fix(populate): allow deselecting discriminator key when populating #14155 #3230
15+
* fix: allow adding discriminators using Schema.prototype.discriminator() to subdocuments after defining parent schema #14131 #14109
16+
* fix(schema): avoid creating unnecessary clone of schematype in nested array so nested document arrays use correct constructor #14128 #14101
17+
* fix(populate): call transform object with single id instead of array when populating a justOne path under an array #14135 #14073
18+
* types: add back mistakenly removed findByIdAndRemove() function signature #14136 #14132
19+
20+
8.0.2 / 2023-11-28
21+
==================
22+
* fix(populate): set populated docs in correct order when populating virtual underneath doc array with justOne #14105
23+
* fix(populate): fix curPath to update appropriately #14099 #14098 [csy1204](https://github.com/csy1204)
24+
* types: make property names show up in intellisense for UpdateQuery #14123 #14090
25+
* types(document): correct return type for doc.deleteOne() re: Mongoose 8 breaking change #14110 #14081
26+
* types: correct types for when includeResultMetadata: true is set #14078
27+
* types(models): allow specifying timestamps as inline option for bulkWrite() operations #14112 #14072
28+
* docs: fix rendering of 7.x server compatibility #14086 [laupow](https://github.com/laupow)
29+
* docs(source/api): fix "index.js" -> "mongoose.js" rename #14125
30+
* docs(README): update breaking change version #14126
31+
132
7.6.6 / 2023-11-27
233
==================
334
* perf: avoid double-running setter logic when calling `push()` #14120 #11380
@@ -10,6 +41,17 @@
1041
* types(model): support calling Model.validate() with pathsToSkip option #14088 #14003
1142
* docs: remove "DEPRECATED" warning mistakenly added to read() tags param #13980
1243

44+
8.0.1 / 2023-11-15
45+
==================
46+
* fix: retain key order with aliases when creating indexes with alias #14042 [meabed](https://github.com/meabed)
47+
* fix: handle nonexistent collection with diffIndexes #14029 #14010
48+
* types(model+query): correctly remove count from TypeScript types to reflect removal of runtime support #14076 #14067 #14062
49+
* types: correct `this` parameter for methods and statics #14028 #14027 [ruxxzebre](https://github.com/ruxxzebre)
50+
* types(model+query): unpack arrays in distinct return type #14047 #14026
51+
* types: add missing Types.UUID typings #14023 #13103 [k725](https://github.com/k725)
52+
* docs: add mongoose 8 to mongodb server compatibility guide #14064
53+
* docs: fix typo in queries.md #14065 [MuhibAhmed](https://github.com/MuhibAhmed)
54+
1355
7.6.5 / 2023-11-14
1456
==================
1557
* fix: handle update validators and single nested doc with numeric paths #14066 #13977
@@ -24,6 +66,10 @@
2466
* fix(document): avoid unmarking modified on nested path if no initial value stored and already modified #14053 #14024
2567
* fix(document): consistently avoid marking subpaths of nested paths as modified #14053 #14022
2668

69+
8.0.0 / 2023-10-31
70+
==================
71+
* docs: add version support notes for Mongoose 8, including EOL date for Mongoose 6
72+
2773
7.6.4 / 2023-10-30
2874
==================
2975
* fix(connection): retain modified status for documents created outside a transaction during transaction retries #14017 #13973
@@ -37,6 +83,23 @@
3783
===================
3884
* fix: add fullPath to ValidatorProps #13995 [Freezystem](https://github.com/Freezystem)
3985

86+
8.0.0-rc0 / 2023-10-24
87+
======================
88+
* BREAKING CHANGE: use MongoDB node driver 6, drop support for rawResult option and findOneAndRemove() #13753
89+
* BREAKING CHANGE: apply minimize by default when updating document #13843
90+
* BREAKING CHANGE: remove `id` setter #13784
91+
* BREAKING CHANGE: remove overwrite option for updateOne(), findOneAndUpdate(), etc. #13989 #13578
92+
* BREAKING CHANGE: make model.prototype.deleteOne() return query, not promise #13660 #13369
93+
* BREAKING CHANGE: remove `Model.count()`, `Query.prototype.count()` #13618 #13598
94+
* BREAKING CHANGE: allow null values for string enum #13620 #3044
95+
* BREAKING CHANGE: make base schema paths come before discriminator schema paths when running setters, validators, etc. #13846 #13794
96+
* BREAKING CHANGE: make Model.validate() use Model.castObject() to cast, and return casted copy of object instead of modifying in place #13287 #12668
97+
* BREAKING CHANGE: make internal file names all camelCase #13950 #13909 #13308
98+
* BREAKING CHANGE: make create() wait for all documents to finish inserting or error out before throwing an error if ordered = false #13621 #4628
99+
* BREAKING CHANGE: refactor out `mongoose/lib/mongoose.js` file to allow importing Mongoose without MongoDB driver #13905
100+
* BREAKING CHANGE(types): allow `null` for optional fields #13901
101+
* BREAKING CHANGE(types): infer return types types for Model.distinct and Query.distinct #13836 [kaulshashank](https://github.com/kaulshashank)
102+
40103
7.6.3 / 2023-10-17
41104
==================
42105
* fix(populate): handle multiple spaces when specifying paths to populate using space-delimited paths #13984 #13951

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ Anyone can file an expense. If the expense makes sense for the development of th
8080
### Contributors
8181

8282
Thank you to all the people who have already contributed to mongoose!
83-
<a href="https://github.com/Automattic/mongoose/graphs/contributors"><img src="https://opencollective.com/mongoose/contributors.svg?width=890" /></a>
83+
<a href="https://github.com/Automattic/mongoose/graphs/contributors"><img src="https://opencollective.com/mongoose/contributors.svg?width=890" alt="Mongoose contributors" /></a>
8484

8585
### Backers
8686

8787
Thank you to all our backers! [[Become a backer](https://opencollective.com/mongoose#backer)]
8888

89-
<a href="https://opencollective.com/mongoose#backers" target="_blank"><img src="https://opencollective.com/mongoose/backers.svg?width=890"></a>
89+
<a href="https://opencollective.com/mongoose#backers" target="_blank"><img src="https://opencollective.com/mongoose/backers.svg?width=890" alt="Mongoose backers"></a>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Mongoose is a [MongoDB](https://www.mongodb.org/) object modeling tool designed
1313

1414
The official documentation website is [mongoosejs.com](http://mongoosejs.com/).
1515

16-
Mongoose 7.0.0 was released on February 27, 2023. You can find more details on [backwards breaking changes in 7.0.0 on our docs site](https://mongoosejs.com/docs/migrating_to_7.html).
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).
1717

1818
## Support
1919

0 commit comments

Comments
 (0)