Skip to content

Commit 118c97a

Browse files
authored
Merge branch 'master' into netlify-functions-example
2 parents 42f40d5 + 1306d00 commit 118c97a

File tree

782 files changed

+8134
-192209
lines changed

Some content is hidden

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

782 files changed

+8134
-192209
lines changed

.eslintrc.json

Lines changed: 66 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,71 @@
44
],
55
"ignorePatterns": [
66
"docs",
7+
"tools",
78
"dist",
8-
"test/files/*"
9+
"website.js",
10+
"test/files/*",
11+
"benchmarks"
912
],
10-
"overrides": [{
11-
"files": [
12-
"**/*.{ts,tsx}"
13-
],
14-
"extends": [
15-
"plugin:@typescript-eslint/eslint-recommended",
16-
"plugin:@typescript-eslint/recommended"
17-
],
18-
"plugins": [
19-
"@typescript-eslint"
20-
],
21-
"rules": {
22-
"@typescript-eslint/triple-slash-reference": "off",
23-
"spaced-comment": ["error", "always", {
24-
"markers": ["/"]
25-
}],
26-
"@typescript-eslint/no-explicit-any": "off",
27-
"@typescript-eslint/ban-types": "off",
28-
"@typescript-eslint/no-unused-vars": "off",
29-
"@typescript-eslint/explicit-module-boundary-types": "off",
30-
"@typescript-eslint/indent": ["error", 2, {
31-
"SwitchCase": 1
32-
}],
33-
"@typescript-eslint/prefer-optional-chain": "error",
34-
"@typescript-eslint/brace-style": "error",
35-
"@typescript-eslint/no-dupe-class-members": "error",
36-
"@typescript-eslint/no-redeclare": "error",
37-
"@typescript-eslint/type-annotation-spacing": "error",
38-
"@typescript-eslint/object-curly-spacing": ["error", "always"],
39-
"@typescript-eslint/semi": "error",
40-
"@typescript-eslint/space-before-function-paren": ["error", "never"],
41-
"@typescript-eslint/space-infix-ops": "off"
13+
"overrides": [
14+
{
15+
"files": [
16+
"**/*.{ts,tsx}"
17+
],
18+
"extends": [
19+
"plugin:@typescript-eslint/eslint-recommended",
20+
"plugin:@typescript-eslint/recommended"
21+
],
22+
"plugins": [
23+
"@typescript-eslint"
24+
],
25+
"rules": {
26+
"@typescript-eslint/triple-slash-reference": "off",
27+
"@typescript-eslint/no-non-null-assertion": "off",
28+
"spaced-comment": [
29+
"error",
30+
"always",
31+
{
32+
"block": {
33+
"markers": [
34+
"!"
35+
],
36+
"balanced": true
37+
},
38+
"markers": [
39+
"/"
40+
]
41+
}
42+
],
43+
"@typescript-eslint/no-explicit-any": "off",
44+
"@typescript-eslint/ban-types": "off",
45+
"@typescript-eslint/no-unused-vars": "off",
46+
"@typescript-eslint/explicit-module-boundary-types": "off",
47+
"@typescript-eslint/indent": [
48+
"error",
49+
2,
50+
{
51+
"SwitchCase": 1
52+
}
53+
],
54+
"@typescript-eslint/prefer-optional-chain": "error",
55+
"@typescript-eslint/brace-style": "error",
56+
"@typescript-eslint/no-dupe-class-members": "error",
57+
"@typescript-eslint/no-redeclare": "error",
58+
"@typescript-eslint/type-annotation-spacing": "error",
59+
"@typescript-eslint/object-curly-spacing": [
60+
"error",
61+
"always"
62+
],
63+
"@typescript-eslint/semi": "error",
64+
"@typescript-eslint/space-before-function-paren": [
65+
"error",
66+
"never"
67+
],
68+
"@typescript-eslint/space-infix-ops": "off"
69+
}
4270
}
43-
}],
71+
],
4472
"plugins": [
4573
"mocha-no-only"
4674
],
@@ -158,6 +186,8 @@
158186
"mocha-no-only/mocha-no-only": [
159187
"error"
160188
],
161-
"no-empty": "off"
189+
"no-empty": "off",
190+
"eol-last": "warn",
191+
"no-multiple-empty-lines": ["warn", { "max": 2 }]
162192
}
163-
}
193+
}

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# These are supported funding model platforms
22

3-
github: vkarpov15
3+
github: mongoosejs
44
open_collective: mongoose
55
tidelift: npm/mongoose

.github/workflows/benchmark.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@ name: Benchmark
22
on:
33
pull_request:
44
paths:
5-
- '.github/workflows/benchmark.yml'
6-
- 'package.json'
7-
- 'types/**'
8-
- 'benchmarks/typescript/**'
9-
- 'benchmarks/typescript.js'
5+
- ".github/workflows/benchmark.yml"
6+
- "package.json"
7+
- "types/**"
8+
- "benchmarks/typescript/**"
109
push:
1110
branches:
1211
- master
1312
paths:
14-
- '.github/workflows/benchmark.yml'
15-
- 'package.json'
16-
- 'types/**'
17-
- 'benchmarks/typescript/**'
18-
- 'benchmarks/typescript.js'
13+
- ".github/workflows/benchmark.yml"
14+
- "package.json"
15+
- "types/**"
16+
- "benchmarks/typescript/**"
1917
permissions:
2018
contents: read
2119

@@ -27,12 +25,12 @@ jobs:
2725
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
2826

2927
- name: Setup node
30-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
28+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
3129
with:
3230
node-version: 16
3331

3432
- run: npm install
3533

36-
- run: node ./benchmarks/typescript
34+
- run: npx ts-benchmark -p ./benchmarks/typescript/simple -f 17/100000 18 29 32 -b master -g --colors
3735
env:
38-
DB_URL: ${{ secrets.DB_URL }}
36+
DB_URL: ${{ secrets.DB_URL }}

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3
3232

3333
- name: Setup node
34-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.0
34+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
3535
with:
3636
node-version: 16
3737

.github/workflows/test.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
2828

2929
- name: Setup node
30-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
30+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
3131
with:
3232
node-version: 14
3333

@@ -37,8 +37,6 @@ jobs:
3737
run: npm run lint-js
3838

3939
test:
40-
needs:
41-
- lint
4240
runs-on: ${{ matrix.os }}
4341
strategy:
4442
fail-fast: false
@@ -60,7 +58,7 @@ jobs:
6058
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
6159

6260
- name: Setup node
63-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
61+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
6462
with:
6563
node-version: ${{ matrix.node }}
6664

@@ -86,7 +84,7 @@ jobs:
8684
steps:
8785
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
8886
- name: Setup node
89-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
87+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
9088
with:
9189
node-version: 16
9290
- run: npm install
@@ -101,7 +99,7 @@ jobs:
10199
steps:
102100
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
103101
- name: Setup node
104-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
102+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
105103
with:
106104
node-version: 16
107105
- run: npm install
@@ -132,4 +130,4 @@ jobs:
132130
- name: Check out repo
133131
uses: actions/checkout@v3
134132
- name: Dependency review
135-
uses: actions/dependency-review-action@v1
133+
uses: actions/dependency-review-action@v2

.github/workflows/tidelift-alignment.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- '.github/workflows/tidelift-alignment.yml'
66
- 'package.json'
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
name: Run Tidelift to ensure approved open source packages are in use
@@ -13,7 +16,7 @@ jobs:
1316
- name: Checkout
1417
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
1518
- name: Setup node
16-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
19+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
1720
with:
1821
node-version: 16
1922
- name: Alignment

.github/workflows/tsd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
2626

2727
- name: Setup node
28-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
28+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
2929
with:
3030
node-version: 14
3131

@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
4444

4545
- name: Setup node
46-
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # v3.1.1
46+
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
4747
with:
4848
node-version: 12
4949

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,11 @@ docs/tutorials/*.html
4949
docs/typescript/*.html
5050
docs/api/*.html
5151
index.html
52+
5253
# Local Netlify folder
5354
.netlify
55+
56+
# yarn package-lock
57+
yarn.lock
58+
59+
examples/ecommerce-netlify-functions/.netlify/state.json

CHANGELOG.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1+
6.4.4 / 2022-07-08
2+
==================
3+
* fix(types): allow using an object to configure timestamps #12061 [lantw44](https://github.com/lantw44)
4+
* fix(types): support findOneAndReplace with rawResult #12062 [lantw44](https://github.com/lantw44)
5+
* docs: upgrade API documentation parser #12078 #12072 #12071 #12024 [hasezoey](https://github.com/hasezoey)
6+
* docs(document): add more info on $isNew #11990
7+
* docs: add SchemaType doValidate() to docs #12068
8+
9+
6.4.3 / 2022-07-05
10+
==================
11+
* fix(document): handle validating deeply nested subdocuments underneath nested paths with required: false #12021
12+
* fix(types): infer schematype type from schema paths when calling `SchemaType.path()` #11987
13+
* fix(types): add $top and $topN aggregation operators #12053
14+
* fix(types): clean up a couple of issues with $add and $ifNull #12017
15+
* fix(types): allow $cond with $in #12028
16+
* docs: add path level descending index example in docs #12023 [MitchellCash](https://github.com/MitchellCash)
17+
* docs: add Buffer, Decimal128, Map to docs #11971
18+
19+
6.4.2 / 2022-07-01
20+
==================
21+
* fix: keep autoIndex & autoCreate as true by default if read preference is primaryPreferred #11976
22+
* fix(types): improve inferred Schema Type to handle nested paths and ObjectIds #12007 [iammola](https://github.com/iammola)
23+
* fix(types): avoid inferring doc type from param to create() #12001
24+
* fix(types): make populate Paths generic consistently overwrite doc interface #11955
25+
* fix(types): allow null at ne expression second parameter #11996 [jyeros](https://github.com/jyeros)
26+
* fix(types): change index "weights" to be more explicit #11997 [hasezoey](https://github.com/hasezoey)
27+
28+
6.4.1 / 2022-06-27
29+
==================
30+
* fix(schema): allow 0 for numbers if required and ref both set #11912
31+
* fix(query): skip applying default projections over slice projections #11940
32+
* fix(types): handle arrays in ApplyBasicQueryCasting correctly #11964
33+
* fix(types): fix $match typings #11969 [andreialecu](https://github.com/andreialecu)
34+
* fix(types): avoid adding non-existent properties from model constructor for typegoose #11960
35+
* fix(types): make Mongoose UpdateQuery compatible with MongoDB `UpdateFilter` #11911
36+
* fix(types): simplify MergeType constraints #11978
37+
* fix(types): correct references to Buffer for @types/node >= 16.0.0 < 16.6.0 #11963
38+
* fix(types): re-add the possibility to pass undefined for projection in Model.find #11965 [ghost91-](https://github.com/ghost91-)
39+
* fix(types): fix typo for indexes #11953 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
40+
* fix(document+types): document merge option #11913
41+
* docs: update schematypes.md #11981 [korzio](https://github.com/korzio)
42+
* docs: update validation.md #11982 [korzio](https://github.com/korzio)
43+
44+
6.4.0 / 2022-06-17
45+
==================
46+
* feat: upgrade mongodb driver -> 4.7.0 #11909 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
47+
* feat(types+document): add $assertPopulated() for working with manually populated paths in TypeScript #11843
48+
* feat(mongoose): add setDriver() function to allow overwriting driver in a more consistent way #11900
49+
* feat(types): add helpers to infer schema type automatically #11563 [mohammad0-0ahmad](https://github.com/mohammad0-0ahmad)
50+
* feat: add `transform` option to `lean()` #10423 [IslandRhythms](https://github.com/IslandRhythms)
51+
* feat(base): add support to set default immutable for createdAt globally #11888 [AbdelrahmanHafez](https://github.com/AbdelrahmanHafez)
52+
* fix: make doValidate() on document array elements run validation on the whole subdoc #11902
53+
* feat(types): add expression typings to Aggregate stages #11370 [Uzlopak](https://github.com/Uzlopak)
54+
* fix: remove `on` from schema reserved keys #11580 [IslandRhythms](https://github.com/IslandRhythms)
55+
56+
6.3.9 / 2022-06-17
57+
==================
58+
* fix(document): handle nested paths underneath subdocuments when getting all subdocuments for pre save hooks #11917
59+
* fix(types): correct typing in post aggregate hooks #11924 [GCastilho](https://github.com/GCastilho)
60+
* docs: remove connect-option reconnectTries and reconnectInterval #11930 [Uzlopak](https://github.com/Uzlopak)
61+
62+
6.3.8 / 2022-06-13
63+
==================
64+
* fix: revert 670b445b0fc perf optimizations that caused some test failures #11541
65+
66+
6.3.7 / 2022-06-13
67+
==================
68+
* fix(schema+document): allow disabling _id on subdocuments by default #11541
69+
* fix(update): respect global strictQuery option when casting array filters #11836
70+
* perf(document): avoid unnecessarily creating new options object on every `$set` #11541
71+
* fix: toJSON with undefined path #11922 [kerryChen95](https://github.com/kerryChen95)
72+
* fix: add refPath to SchemaTypeOptions class #11862
73+
* fix(types): handle boolean default functions #11828
74+
* docs(populate): make path names in refPath section consistent #11724
75+
76+
6.3.6 / 2022-06-07
77+
==================
78+
* fix(update): apply timestamps to nested subdocs within $push and $addToSet #11775
79+
* fix(document): use shallow clone instead of deep clone for `toObject()` options #11776
80+
* fix: avoid checking for ObjectId with instanceof #11891 [noseworthy](https://github.com/noseworthy)
81+
* fix(types): Allow sorting by text score #11893
82+
* fix(types): allow schematype get() functions to return undefined #11561
83+
* fix(types): add Schema.discriminator #11855 [Uzlopak](https://github.com/Uzlopak)
84+
* fix(types): discriminator generic type not being passed to schema #11898 [GCastilho](https://github.com/GCastilho)
85+
186
6.3.5 / 2022-05-30
287
==================
388
* fix(document): avoid infinite recursion when calling toObject() on self-referencing document #11756

0 commit comments

Comments
 (0)