Skip to content

Commit

Permalink
add the dialect mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
slayerMonkeys committed Aug 29, 2021
1 parent 315a4bb commit 838a180
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/dialects/mongodb/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Dialect from "../../core/Dialect";
import Mistial from "../../index";

/**
* Dialect for mongodb
*/
class Mongodb extends Dialect {
/**
* mongoose the mongodb object modeler
* @private
*/
private lib: any;

/**
* Instantiate the mongodb dialect
* @param mistial
*/
constructor(mistial: Mistial) {
super(mistial);

this.lib = this.loadDialectModule('mongoose')
}

/**
* Connect with mongodb database on config
* @private
*/
private _connect(): void {
this.lib.connect(this.mistial.options.uri!, this.mistial.options.dialectModuleOptions)
}
}

export default Mongodb;

0 comments on commit 838a180

Please sign in to comment.