Skip to content

Commit

Permalink
dependencies(mongoose): upgrade to 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Apr 29, 2023
1 parent d2739b9 commit 017b7a1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/guides/error-warning-details.md
Expand Up @@ -7,7 +7,7 @@ title: 'Error & Warning Details'

### Mongoose Version [E001]

Error: `Please use mongoose 7.0.3 or higher (Current mongoose: x.x.x) [E001]`
Error: `Please use mongoose 7.1.0 or higher (Current mongoose: x.x.x) [E001]`

Error Class: `Error`

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/migration/migrate-11.md
Expand Up @@ -11,7 +11,7 @@ This Guide is written for migration from version `10.3.3` to `11.0.0`, for versi

## Requirements changed

- Mongoose `7.0.3` or higher is now required
- Mongoose `7.1.0` or higher is now required

## Default class `FindOrCreate` has been removed

Expand Down
1 change: 1 addition & 0 deletions docs/guides/mongoose-compatibility.md
Expand Up @@ -9,6 +9,7 @@ If no upper mongoose version is defined and a newer typegoose version exists wit

| Typegoose Version | Mongoose Version |
| ----------------- | ---------------- |
| 11.1.x | ~7.1.0 |
| 11.0.x | ~7.0.3 |
| 10.3.x | ~6.10.0 |
| 10.2.x | ~6.10.0 |
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/quick-start-guide.md
Expand Up @@ -108,7 +108,7 @@ Like `public: string[]` is in reflection only `Array`.

- TypeScript version `^4.9` (since 10.0) is recommended, though older ones may also work
- NodeJS `^14.17.0` (and `@types/node@16`)
- Mongoose `~7.0.3`
- Mongoose `~7.1.0`
- A IDE that supports TypeScript linting is recommended to be used (VSCode is recommended)
- This Guide expects you to know how Mongoose (or at least its models) works
- `experimentalDecorators` and `emitDecoratorMetadata` must be enabled in `tsconfig.json`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -36,7 +36,7 @@
],
"license": "MIT",
"peerDependencies": {
"mongoose": "~7.0.3"
"mongoose": "~7.1.0"
},
"devDependencies": {
"@commitlint/cli": "^17.6.1",
Expand Down Expand Up @@ -66,7 +66,7 @@
"jest-runner-tsd": "^4.0.0",
"lint-staged": "^13.2.2",
"mongodb-memory-server": "^8.12.2",
"mongoose": "~7.0.3",
"mongoose": "~7.1.0",
"prettier": "^2.8.8",
"rimraf": "^4.4.1",
"semantic-release": "^19.0.5",
Expand Down
6 changes: 3 additions & 3 deletions src/hooks.ts
Expand Up @@ -3,7 +3,7 @@ import type {
AggregateExtract,
CallbackError,
Document,
DocumentOrQueryMiddleware,
MongooseQueryOrDocumentMiddleware,
ErrorHandlingMiddlewareFunction,
HydratedDocument,
Model,
Expand Down Expand Up @@ -108,12 +108,12 @@ interface Hooks {

// special pre hooks for each "document: true, query: false" and "document: false, query: true"
pre<S extends object | HydratedDocument<any, any>, T = S extends Document ? S : HydratedDocument<DocumentType<S>, any>>(
method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[],
method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[],
fn: PreMiddlewareFunction<T>,
options: SchemaPreOptions & { document: true; query: false }
): ClassDecorator;
pre<S extends object | Query<any, any>, T = S extends Query<any, any> ? S : Query<DocumentType<S>, DocumentType<S>>>(
method: DocumentOrQueryMiddleware | DocumentOrQueryMiddleware[],
method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[],
fn: PreMiddlewareFunction<T>,
options: SchemaPreOptions & { document: false; query: true }
): ClassDecorator;
Expand Down
4 changes: 2 additions & 2 deletions src/typegoose.ts
Expand Up @@ -19,8 +19,8 @@ import {
if (typeof process !== 'undefined' && !isNullOrUndefined(process?.version) && !isNullOrUndefined(mongoose?.version)) {
// for usage on client side
/* istanbul ignore next */
if (semver.lt(mongoose?.version, '7.0.3')) {
throw new Error(`Please use mongoose 7.0.3 or higher (Current mongoose: ${mongoose.version}) [E001]`);
if (semver.lt(mongoose?.version, '7.1.0')) {
throw new Error(`Please use mongoose 7.1.0 or higher (Current mongoose: ${mongoose.version}) [E001]`);
}

/* istanbul ignore next */
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Expand Up @@ -2668,10 +2668,10 @@ bson@^4.7.0:
dependencies:
buffer "^5.6.0"

bson@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/bson/-/bson-5.0.1.tgz#4cd3eeeabf6652ef0d6ab600f9a18212d39baac3"
integrity sha512-y09gBGusgHtinMon/GVbv1J6FrXhnr/+6hqLlSmEFzkz6PodqF6TxjyvfvY3AfO+oG1mgUtbC86xSbOlwvM62Q==
bson@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/bson/-/bson-5.2.0.tgz#c81d35dd30e2798203e5422a639780ea98dd25ba"
integrity sha512-HevkSpDbpUfsrHWmWiAsNavANKYIErV2ePXllp1bwq5CDreAaFVj6RVlZpJnxK4WWDCJ/5jMUpaY6G526q3Hjg==

buffer-crc32@~0.2.3:
version "0.2.13"
Expand Down Expand Up @@ -5467,12 +5467,12 @@ mongodb-memory-server@^8.12.2:
mongodb-memory-server-core "8.12.2"
tslib "^2.5.0"

mongodb@5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.1.0.tgz#e551f9e496777bde9173e51d16c163ab2c805b9d"
integrity sha512-qgKb7y+EI90y4weY3z5+lIgm8wmexbonz0GalHkSElQXVKtRuwqXuhXKccyvIjXCJVy9qPV82zsinY0W1FBnJw==
mongodb@5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.3.0.tgz#9bef3ff35511a66fb7d9aafb7b06112787138db1"
integrity sha512-Wy/sbahguL8c3TXQWXmuBabiLD+iVmz+tOgQf+FwkCjhUIorqbAxRbbz00g4ZoN4sXIPwpAlTANMaGRjGGTikQ==
dependencies:
bson "^5.0.1"
bson "^5.2.0"
mongodb-connection-string-url "^2.6.0"
socks "^2.7.1"
optionalDependencies:
Expand All @@ -5490,14 +5490,14 @@ mongodb@^4.13.0:
"@aws-sdk/credential-providers" "^3.186.0"
saslprep "^1.0.3"

mongoose@~7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-7.0.3.tgz#576375acb436f96cd3350fb63fddbac7ae51ff9c"
integrity sha512-3n8vc1/mssuxKa6vfghSocp3MeiCFYzhX36Ok+PsDNNYzHC9tw3rNkAMLemIwZ2jgXqkZ7CfKOxkzjp/d/SWfg==
mongoose@~7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-7.1.0.tgz#ad7f23184a0c19eb8efbbad4f1ff2113ede1515d"
integrity sha512-shoo9z/7o96Ojx69wpJn65+EC+Mt3q1SWTducW+F2Y4ieCXo0lZwpCZedgC841MIvJ7V8o6gmzoN1NfcnOTOuw==
dependencies:
bson "^5.0.1"
bson "^5.2.0"
kareem "2.5.1"
mongodb "5.1.0"
mongodb "5.3.0"
mpath "0.9.0"
mquery "5.0.0"
ms "2.1.3"
Expand Down

0 comments on commit 017b7a1

Please sign in to comment.