1.0.1 • Published 6 years ago
mango-aliyan v1.0.1
Mango Aliyan
easy to use mongodb librabry using mongo driver module.
** callback will be replaced with async/promices soon.
npm i mango-aliyan
const URL = "mongodb://127.0.0.1:27017/";
const collectionStructure ={
"schooldb":["studentCollection","staffCollection"]
};
const mongo = new MangoAliyan(URL,collectionStructure,onceDBIsReady);
function onceDBIsReady(err, mongo){
console.info("connected..");
/*any db operations to be performed after establishing the connectivity*/
/*mongo.schooldb.studentCollection.[insert/distinct/findOne etc](..)*/
}
mongo.schooldb.studentCollection.[insert/distinct/findOne etc](..)