Skip to content

Commit

Permalink
fix(deps): Updates the Node Mongo Driver to v3.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryasmi committed Jan 11, 2018
1 parent e300954 commit b44c095
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 50 deletions.
58 changes: 11 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -44,7 +44,7 @@
"knex": "^0.14.0",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"mongodb": "^2.2.29",
"mongodb": "^3.0.1",
"morgan": "^1.8.2",
"newrelic": "^2.3.1",
"rulr": "^4.0.1",
Expand All @@ -63,7 +63,7 @@
"@types/lodash": "4.14.92",
"@types/mocha": "2.2.46",
"@types/moment": "2.13.0",
"@types/mongodb": "2.2.18",
"@types/mongodb": "^2.2.18",
"@types/morgan": "1.7.35",
"@types/uuid": "3.4.3",
"@types/winston": "2.3.7",
Expand All @@ -80,4 +80,4 @@
"publishConfig": {
"access": "public"
}
}
}
11 changes: 11 additions & 0 deletions src/mongoRepo/utils/connectToDb.ts
@@ -0,0 +1,11 @@
import { Db, MongoClient } from 'mongodb';

export interface Opts {
readonly dbName: string;
readonly url: string;
}

export default async ({ dbName, url }: Opts): Promise<Db> => {
const client = await MongoClient.connect(url);
return client.db(dbName);
};

0 comments on commit b44c095

Please sign in to comment.