@brickyang/easy-mongodb
Advanced tools
Comparing version 1.1.2 to 2.0.0
@@ -71,6 +71,3 @@ 'use strict'; | ||
connect() { | ||
return MongoClient.connect( | ||
this.url, | ||
this.clientOptions | ||
) | ||
return MongoClient.connect(this.url, this.clientOptions) | ||
.then(async client => { | ||
@@ -653,2 +650,2 @@ this.client = client; | ||
module.exports = MongoDB; | ||
module.exports = { default: MongoDB }; |
{ | ||
"name": "@brickyang/easy-mongodb", | ||
"version": "1.1.2", | ||
"version": "2.0.0", | ||
"description": "Based on MongoDB Native Node.js Driver.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -99,4 +99,7 @@ [![NPM version][npm-image]][npm-url] | ||
```js | ||
const MongoDB = require('@brickyang/easy-mongodb'); | ||
// TypeScript | ||
// import MongoDB from '@brickyang/easy-mongodb'; | ||
const MongoDB = require('@brickyang/easy-mongodb').default; | ||
const mongo = new MongoDB(config); | ||
@@ -103,0 +106,0 @@ |
@@ -98,4 +98,7 @@ [![NPM version][npm-image]][npm-url] | ||
```js | ||
const MongoDB = require('@brickyang/easy-mongodb'); | ||
// TypeScript | ||
// import MongoDB from '@brickyang/easy-mongodb'; | ||
const MongoDB = require('@brickyang/easy-mongodb').default; | ||
const mongo = new MongoDB(config); | ||
@@ -102,0 +105,0 @@ |
48630
203
790