connect
Connect to a mongo database to access some functions ! Requires mongodb uri
Program
- Javascript
- Typescript
const simplydjs = require("simply-djs");
import simplydjs from "simply-djs";
simplydjs.connect('mongodb uri')
INFO
This should be implemented in the main/index file and next to the declaration of the package !
index.js
const simplydjs = require("simply-djs");
simplydjs.connect() // connect function at the next line
Arguments:
simplydjs.connect(
db: string,
notify?: boolean
)
- db:
string
- notify:
boolean
info
notify
option is used so that it console logs when the database is connected !
[Default is true] !