Main Class
The Documentation for the main class of abc.db
Requiring/Importing
//Use only one of these (es6 usually only is used in ts)
//es6
import AbcDB from "abc.db";
//commonjs
const AbcDB = require("abc.db")Constructing the Class
const DB = new AbcDB("Mongo connection uri", "your database name");
/*
you can put a database name inside the second option
but it is not mandatory, by default it uses the name "test"
*/v1
const DB = new AbcDB("Mongo connection uri", {});
//you can put mongoose options as the second part
//but they are not needed. The {} is not needed either
//i have just left it to show where to put the options.Class Events
Since v2, Events have been removed, but will be left here as a reference
Connected
Disconnected
Reconnected
Methods
Connect - Promise
Collections
v1
Last updated