-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
315a4bb
commit 838a180
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |