Skip to content

Commit 9ce4153

Browse files
committed
Merge branch 'master' into 8.0
2 parents f7afc96 + d5964cd commit 9ce4153

24 files changed

+171
-39
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-20.04
2323
name: Benchmark TypeScript Types
2424
steps:
25-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
25+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
2626
with:
2727
fetch-depth: 0
2828
- name: Setup node

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

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

.github/workflows/documentation.yml

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

3333
- name: Setup node
3434
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-20.04
4949
name: Test Generating Docs
5050
steps:
51-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
51+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
5252
- run: git fetch --depth=1 --tags # download all tags for documentation
5353

5454
- name: Setup node

.github/workflows/test.yml

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

2727
- name: Setup node
2828
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
@@ -58,7 +58,7 @@ jobs:
5858
MONGOMS_PREFER_GLOBAL_PATH: 1
5959
FORCE_COLOR: true
6060
steps:
61-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
61+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
6262

6363
- name: Setup node
6464
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
@@ -94,7 +94,7 @@ jobs:
9494
MONGOMS_PREFER_GLOBAL_PATH: 1
9595
FORCE_COLOR: true
9696
steps:
97-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
97+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
9898
- name: Setup node
9999
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
100100
with:
@@ -122,7 +122,7 @@ jobs:
122122
env:
123123
FORCE_COLOR: true
124124
steps:
125-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
125+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
126126
- name: Setup node
127127
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
128128
with:
@@ -139,6 +139,6 @@ jobs:
139139
contents: read
140140
steps:
141141
- name: Check out repo
142-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
142+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
143143
- name: Dependency review
144144
uses: actions/dependency-review-action@v3

.github/workflows/tidelift-alignment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
if: github.repository == 'Automattic/mongoose'
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
18+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
1919
- name: Setup node
2020
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
2121
with:

.github/workflows/tsd.yml

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

2727
- name: Setup node
2828
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
name: Test Typescript Types
4242
steps:
43-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
43+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
4444

4545
- name: Setup node
4646
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
7.5.4 / 2023-10-04
2+
==================
3+
* fix: avoid stripping out `id` property when `_id` is set #13933 #13892 #13867
4+
* fix(QueryCursor): avoid double-applying schema paths so you can include select: false fields with + projection using cursors #13932 #13773
5+
* fix(query): allow deselecting discriminator key using - syntax #13929 #13760
6+
* fix(query): handle $round in $expr as array #13928 #13881
7+
* fix(document): call pre('validate') hooks when modifying a path underneath triply nested subdoc #13912 #13876
8+
* fix(mongoose): correctly handle global applyPluginsToChildSchemas option #13911 #13887
9+
* types: add insertMany array overload with options #13931 [t1bb4r](https://github.com/t1bb4r)
10+
* docs(compatibility): add Mongoose 7 support to compatibility matrix #13875
11+
* docs: amend some awkward FAQ wording #13925 [peteboere](https://github.com/peteboere)
12+
113
7.5.3 / 2023-09-25
214
==================
315
* fix(document): handle MongoDB Long when casting BigInts #13869 #13791

docs/compatibility.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Below are the [semver](http://semver.org/) ranges representing which versions of
1818

1919
| MongoDB Server | Mongoose |
2020
| :------------: | :---------------------------: |
21+
| `7.x` | `^7.4.0` |
2122
| `6.x` | `^6.5.0 \| ^7.0.0` |
2223
| `5.x` | `^6.0.0 \| ^7.0.0` |
2324
| `4.4.x` | `^5.10.0 \| ^6.0.0 \| ^7.0.0` |

docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ is undefined on the underlying [POJO](guide.html#minimize).
139139

140140
<a class="anchor" href="#arrow-functions">**Q**</a>. I'm using an arrow function for a [virtual](guide.html#virtuals), [middleware](middleware.html), [getter](api/schematype.html#schematype_SchemaType-get)/[setter](api/schematype.html#schematype_SchemaType-set), or [method](guide.html#methods) and the value of `this` is wrong.
141141

142-
**A**. Arrow functions [handle the `this` keyword much differently than conventional functions](https://masteringjs.io/tutorials/fundamentals/arrow#why-not-arrow-functions).
142+
**A**. Arrow functions [handle the `this` keyword differently than conventional functions](https://masteringjs.io/tutorials/fundamentals/arrow#why-not-arrow-functions).
143143
Mongoose getters/setters depend on `this` to give you access to the document that you're writing to, but this functionality does not work with arrow functions. Do **not** use arrow functions for mongoose getters/setters unless do not intend to access the document in the getter/setter.
144144

145145
```javascript

lib/cursor/queryCursor.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const util = require('util');
3434
* @api public
3535
*/
3636

37-
function QueryCursor(query, options) {
37+
function QueryCursor(query) {
3838
// set autoDestroy=true because on node 12 it's by default false
3939
// gh-10902 need autoDestroy to destroy correctly and emit 'close' event
4040
Readable.call(this, { autoDestroy: true, objectMode: true });
@@ -46,7 +46,7 @@ function QueryCursor(query, options) {
4646
this._mongooseOptions = {};
4747
this._transforms = [];
4848
this.model = model;
49-
this.options = options || {};
49+
this.options = {};
5050
model.hooks.execPre('find', query, (err) => {
5151
if (err != null) {
5252
if (err instanceof kareem.skipWrappedFunction) {
@@ -70,20 +70,18 @@ function QueryCursor(query, options) {
7070
this.listeners('error').length > 0 && this.emit('error', err);
7171
return;
7272
}
73+
Object.assign(this.options, query._optionsForExec());
7374
this._transforms = this._transforms.concat(query._transforms.slice());
7475
if (this.options.transform) {
75-
this._transforms.push(options.transform);
76+
this._transforms.push(this.options.transform);
7677
}
7778
// Re: gh-8039, you need to set the `cursor.batchSize` option, top-level
7879
// `batchSize` option doesn't work.
7980
if (this.options.batchSize) {
80-
this.options.cursor = options.cursor || {};
81-
this.options.cursor.batchSize = options.batchSize;
82-
8381
// Max out the number of documents we'll populate in parallel at 5000.
8482
this.options._populateBatchSize = Math.min(this.options.batchSize, 5000);
8583
}
86-
Object.assign(this.options, query._optionsForExec());
84+
8785
if (model.collection._shouldBufferCommands() && model.collection.buffer) {
8886
model.collection.queue.push([
8987
() => _getRawCursor(query, this)

0 commit comments

Comments
 (0)