Constructor Summary
Public Constructor | ||
public |
constructor(PopApi: PopApi, options: Object) Create a new Database object. |
Member Summary
Public Members | ||
public |
The name of the database. |
|
public |
The port of the database. |
|
public |
The host of the server of the database. |
|
public |
The password of the database. |
|
public |
The username of the database. |
Method Summary
Public Methods | ||
public |
Connection and configuration of the database. |
|
public |
disconnect(): Promise<undefined, Error> Disconnect from the database. |
|
public |
Export a JSON file collection. |
|
public |
Import a JSON file collection. |
Public Constructors
public constructor(PopApi: PopApi, options: Object) source
Create a new Database object.
Params:
Name | Type | Attribute | Description |
PopApi | PopApi |
|
The PopApi instance to bind the database to. |
options | Object |
|
The options for the database. |
options.database | string |
|
The arguments to be parsed by |
options.hosts | Array<string> |
|
The hosts for the database connection. |
options.dbPort | number |
|
The port for the database connection. |
options.username | string |
|
The username for the database connection. |
options.password | string |
|
The password for the database connection. |
Throw:
'database' is a required option for the Database middleware! |
Public Members
Public Methods
public exportFile(collection: string, outputFile: string): Promise<string, undefined> source
Export a JSON file collection.