Skip to content

Commit

Permalink
dependencies(mongoose): upgrade to 6.3.0
Browse files Browse the repository at this point in the history
also upgrades @typegoose/typegoose to 9.8.0
  • Loading branch information
hasezoey committed Apr 16, 2022
1 parent 4bc4dcc commit 4bd1303
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ I started `@typegoose/auto-increment` because `mongoose-auto-increment` and `mon

- Node 12.22.0+
- TypeScript 4.4+ (older versions could work, but are not tested)
- mongoose 6.2+
- mongoose 6.3+

## Install

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"contributors": [],
"license": "MIT",
"peerDependencies": {
"mongoose": "~6.2.3"
"mongoose": "~6.3.0"
},
"devDependencies": {
"@commitlint/cli": "^16.2.3",
Expand All @@ -41,7 +41,7 @@
"@semantic-release/github": "^7.2.3",
"@semantic-release/npm": "^7.1.3",
"@semantic-release/release-notes-generator": "^9.0.3",
"@typegoose/typegoose": "~9.7.0",
"@typegoose/typegoose": "~9.8.0",
"@types/jest": "^27.4.1",
"@types/node": "~12.12.6",
"@typescript-eslint/eslint-plugin": "^5.19.0",
Expand All @@ -54,7 +54,7 @@
"jest": "^27.5.1",
"lint-staged": "^11.2.6",
"mongodb-memory-server": "^8.5.0",
"mongoose": "~6.2.3",
"mongoose": "~6.3.0",
"prettier": "^2.6.2",
"rimraf": "3.0.2",
"semantic-release": "^17.4.7",
Expand Down
13 changes: 11 additions & 2 deletions src/autoIncrement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ export function AutoIncrementSimple(
}

/** The Schema used for the trackers */
const IDSchema = new mongoose.Schema<AutoIncrementIDTrackerSpecDoc>(
const IDSchema = new mongoose.Schema<
AutoIncrementIDTrackerSpecDoc,
mongoose.Model<AutoIncrementIDTrackerSpecDoc>,
Record<string, unknown>,
Record<string, unknown>
>(
{
field: String,
// @ts-expect-error somehow "modelName" gets removed from the type
Expand Down Expand Up @@ -109,7 +114,11 @@ export function AutoIncrementID(schema: mongoose.Schema<any>, options: AutoIncre
logger.info('Creating idtracker model named "%s"', opt.trackerModelName);
// needs to be done, otherwise "undefiend" error if the plugin is used in an sub-document
const db: mongoose.Connection = this.db ?? (this as any).ownerDocument().db;
model = db.model<AutoIncrementIDTrackerSpecDoc>(opt.trackerModelName, IDSchema, opt.trackerCollection);
model = db.model<AutoIncrementIDTrackerSpecDoc, mongoose.Model<AutoIncrementIDTrackerSpecDoc>, Record<string, unknown>>(
opt.trackerModelName,
IDSchema,
opt.trackerCollection
);
// test if the counter document already exists
const counter = await model
.findOne({
Expand Down
59 changes: 16 additions & 43 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1281,15 +1281,15 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==

"@typegoose/typegoose@~9.7.0":
version "9.7.0"
resolved "https://registry.yarnpkg.com/@typegoose/typegoose/-/typegoose-9.7.0.tgz#43b22fb3bed0016405448d13adc3173d096dc251"
integrity sha512-x5z0WDkyt4AF5EZJH5LpI/IJcCkD7c2AmP0V15400BVqBY2FSGWls8C8pn8FIF+YaqED3LItHcHkDHGc3WklJg==
"@typegoose/typegoose@~9.8.0":
version "9.8.0"
resolved "https://registry.yarnpkg.com/@typegoose/typegoose/-/typegoose-9.8.0.tgz#2813f04a282cf6fefe7b213bbb22e8798560ffa1"
integrity sha512-YMwyy2jHMVy4T9cIdwpNcg4VmBsGe7ijIsSJz1hDxmYo4JeXhqCPl4fS1+rig4bXCYIupCiBujLdVp385FJdOQ==
dependencies:
lodash "^4.17.20"
loglevel "^1.8.0"
reflect-metadata "^0.1.13"
semver "^7.3.2"
semver "^7.3.7"
tslib "^2.3.1"

"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14":
Expand Down Expand Up @@ -1967,13 +1967,6 @@ bson@^4.2.2:
dependencies:
buffer "^5.6.0"

bson@^4.6.1:
version "4.6.1"
resolved "https://registry.yarnpkg.com/bson/-/bson-4.6.1.tgz#2b5da517539bb0f7f3ffb54ac70a384ca899641c"
integrity sha512-I1LQ7Hz5zgwR4QquilLNZwbhPw0Apx7i7X9kGMBTsqPdml/03Q9NBtD9nt/19ahjlphktQImrnderxqpzeVDjw==
dependencies:
buffer "^5.6.0"

bson@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/bson/-/bson-4.6.2.tgz#3241c79d23d225b86ab6d2bc268b803d8a5fd444"
Expand Down Expand Up @@ -4384,10 +4377,10 @@ just-diff@^3.0.1:
resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-3.1.1.tgz#d50c597c6fd4776495308c63bdee1b6839082647"
integrity sha512-sdMWKjRq8qWZEjDcVA6llnUT8RDEBIfOiGpYFPYa9u+2c39JCsejktSP7mj5eRid5EIvTzIpQ2kDOCw1Nq9BjQ==

kareem@2.3.4:
version "2.3.4"
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.4.tgz#b38c436fb4758775d919b2828b4009db59b52694"
integrity sha512-Vcrt8lcpVl0s8ePx634BxwRqmFo+5DcOhlmNadehxreMTIQi/9hOL/B3hZQQbK5DgMS7Lem3xABXV7/S3jy+7g==
kareem@2.3.5:
version "2.3.5"
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.5.tgz#111fe9dbab754c8ed88b7a2360e2680cec1420ca"
integrity sha512-qxCyQtp3ioawkiRNQr/v8xw9KIviMSSNmy+63Wubj7KmMn3g7noRXIZB4vPCAP+ETi2SR8eH6CvmlKZuGpoHOg==

kind-of@^6.0.3:
version "6.0.3"
Expand Down Expand Up @@ -4910,14 +4903,6 @@ modify-values@^1.0.0:
resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==

mongodb-connection-string-url@^2.4.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.1.tgz#6ac33906256b182761b141addf7c64e56b0ed4d1"
integrity sha512-0GAJKc1LBXzlWPhtj9uGawIlYSkTXkgpW9wZ97b4ySEuKbE5j9a0OdLGM31AWMhRS2ut49Z0kufSYsamGEIb8Q==
dependencies:
"@types/whatwg-url" "^8.2.1"
whatwg-url "^11.0.0"

mongodb-connection-string-url@^2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.2.tgz#f075c8d529e8d3916386018b8a396aed4f16e5ed"
Expand Down Expand Up @@ -4956,19 +4941,7 @@ mongodb-memory-server@^8.5.0:
mongodb-memory-server-core "8.5.0"
tslib "^2.3.1"

mongodb@4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-4.3.1.tgz#e346f76e421ec6f47ddea5c8f5140e6181aaeb94"
integrity sha512-sNa8APSIk+r4x31ZwctKjuPSaeKuvUeNb/fu/3B6dRM02HpEgig7hTHM8A/PJQTlxuC/KFWlDlQjhsk/S43tBg==
dependencies:
bson "^4.6.1"
denque "^2.0.1"
mongodb-connection-string-url "^2.4.1"
socks "^2.6.1"
optionalDependencies:
saslprep "^1.0.3"

mongodb@^4.5.0:
mongodb@4.5.0, mongodb@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-4.5.0.tgz#d74c2008567b606dccef220f62a44cd7b934eb92"
integrity sha512-A2l8MjEpKojnhbCM0MK3+UOGUSGvTNNSv7AkP1fsT7tkambrkkqN/5F2y+PhzsV0Nbv58u04TETpkaSEdI2zKA==
Expand All @@ -4980,14 +4953,14 @@ mongodb@^4.5.0:
optionalDependencies:
saslprep "^1.0.3"

mongoose@~6.2.3:
version "6.2.3"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-6.2.3.tgz#146f718a8af95893827c5ab621697117be426256"
integrity sha512-FxF2D0MGGIw9bAJ57nSyM4Hs4tDHbu6dn9gQwT1J/lxmRB8jfaWWJ3FSJXTmeYlQ6BpyKeIaT8fj6SAX0YMNBA==
mongoose@~6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-6.3.0.tgz#701b46d501c7fe01d9bfccf94f208e80e2bb183c"
integrity sha512-3x2pEGlZ5SorqcL0/hmUIAzzHIh6a/VIAEv3zAmc93qDtSz3WBbF8PwYYHcXm6Awfck9/zFOV9KIUEE+HjVepA==
dependencies:
bson "^4.2.2"
kareem "2.3.4"
mongodb "4.3.1"
kareem "2.3.5"
mongodb "4.5.0"
mpath "0.8.4"
mquery "4.0.2"
ms "2.1.3"
Expand Down

0 comments on commit 4bd1303

Please sign in to comment.