Skip to content

Commit

Permalink
feat: use mongodb@5, require Node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Jan 31, 2023
1 parent 3797abd commit 89cd71c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 791 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@naturalcycles/db-lib": "^8.0.1",
"@naturalcycles/js-lib": "^14.0.0",
"@naturalcycles/nodejs-lib": "^12.2.2",
"mongodb": "^4.0.0"
"mongodb": "^5.0.0"
},
"devDependencies": {
"@naturalcycles/dev-lib": "^13.6.0",
Expand All @@ -33,7 +33,7 @@
"url": "https://github.com/NaturalCycles/mongo-lib"
},
"engines": {
"node": ">=16.10.0"
"node": ">=18.12.0"
},
"version": "3.4.16",
"description": "MongoDB implementation of CommonDB interface",
Expand Down
6 changes: 3 additions & 3 deletions src/mongo.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class MongoDB extends BaseCommonDB implements CommonDB {
rows.map(r => ({
replaceOne: {
filter: {
_id: r.id,
_id: r.id as any,
},
replacement: this.mapToMongo(r as ObjectWithId),
upsert: true,
Expand All @@ -148,7 +148,7 @@ export class MongoDB extends BaseCommonDB implements CommonDB {
.collection(table)
.find({
_id: {
$in: ids,
$in: ids as any[],
},
})
.toArray()) as any as MongoObject<ROW>[]
Expand All @@ -169,7 +169,7 @@ export class MongoDB extends BaseCommonDB implements CommonDB {
.deleteMany(
{
_id: {
$in: ids,
$in: ids as any[],
},
},
opt,
Expand Down
Loading

0 comments on commit 89cd71c

Please sign in to comment.