@fdebijl/mog
Advanced tools
Comparing version 1.2.0 to 1.2.1
import { DbOptions, MongoClientOptions } from 'mongodb'; | ||
export declare type MogOptions = { | ||
url: string; | ||
/** Name of the DB to use */ | ||
db: string; | ||
/** Name of the connecting application, shown in the MongoDB logs and profiler */ | ||
appName?: string; | ||
@@ -6,0 +8,0 @@ /** Default collection that is used for all operations. If not set, a collection must be passed with every operation */ |
import { MongoClient, Db, Filter, Document, WithId, InsertManyResult, InsertOneResult, DeleteResult, UpdateResult, FindCursor } from 'mongodb'; | ||
import { InsertOptions, MogOptions, OperationOptions, GetOptions, UpdateOptions, ListOptions } from './domain'; | ||
import { CountOptions } from './domain/type/CountOptions'; | ||
import { InsertOptions, MogOptions, OperationOptions, GetOptions, UpdateOptions, ListOptions, CountOptions } from './domain'; | ||
export declare class Mog { | ||
@@ -5,0 +4,0 @@ private _isKilled; |
@@ -23,3 +23,6 @@ "use strict"; | ||
try { | ||
this.db = this.client.db(options.db, options.dbOptions); | ||
this.db = this.client.db(); | ||
this.client.connect().then(() => { | ||
this.db = this.client.db(options.db, options.dbOptions); | ||
}); | ||
} | ||
@@ -26,0 +29,0 @@ catch (error) { |
{ | ||
"name": "@fdebijl/mog", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Opionated mini-ODM and collection of MongoDB utils 🔧", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
17173
306