Skip to content

Commit

Permalink
fix: Dependencies related to mongo have been updated (#56)
Browse files Browse the repository at this point in the history
* fix: Dependencies related to mongo have been updated

* fix: test errors
  • Loading branch information
RoxnnyABarriosC committed Sep 4, 2021
1 parent 5e76267 commit b5f3509
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"md5": "^2.3.0",
"minio": "^7.0.18",
"moment": "^2.29.1",
"mongodb": "^3.6.6",
"mongoose": "~5.11.16",
"mongodb": "^4.1.1",
"mongoose": "^6.0.4",
"multer": "^1.4.2",
"node-minio": "^1.0.2",
"nodemailer": "6.5.0",
Expand All @@ -84,6 +84,7 @@
"@shelf/jest-mongodb": "^1.2.4",
"@types/bcrypt": "^3.0.1",
"@types/bcryptjs": "^2.4.2",
"@types/bson": "^4.2.0",
"@types/compression": "^1.7.0",
"@types/config": "^0.0.38",
"@types/cors": "^2.8.10",
Expand All @@ -101,6 +102,8 @@
"@types/lodash": "^4.14.168",
"@types/md5": "^2.3.0",
"@types/minio": "^7.0.7",
"@types/mongodb": "^4.0.7",
"@types/mongoose": "^5.11.97",
"@types/multer": "^1.4.5",
"@types/nodemailer": "^6.4.1",
"@types/pg": "^7.14.1",
Expand Down
4 changes: 2 additions & 2 deletions src/App/Presentation/Shared/MongoPaginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ class MongoPaginator implements IPaginator

public async paginate(): Promise<any>
{
this.total = await this.documentQuery.count().exec();
this.total = await ((this.documentQuery as any).clone()).count();

this.addOrderBy();
this.addPagination();

this._perPage = await this.documentQuery.count().exec();
this._perPage = await ((this.documentQuery as any).clone()).count();
this.setPerPage(this._perPage);
this.setCurrentPage();
this.setLasPage();
Expand Down
7 changes: 1 addition & 6 deletions src/Shared/Database/MongooseCreateConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ class MongooseCreateConnection implements ICreateConnection

async create(): Promise<any>
{
connection = await mongoose.createConnection(this.uri, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex:true,
useFindAndModify:true
});
connection = mongoose.createConnection(this.uri);

// Domain
connection.model<IUserDocument>('User', UserSchema);
Expand Down

0 comments on commit b5f3509

Please sign in to comment.