api/scripts/db.js
// iterate through json for loading different collections
iterate through json for loading different collections
iterate through json for loading different collections
execute(data) {
        this._mc.open().then((db) => {
        }).catch((err) => {
        });
        /*
        // create database
        this._mongoClient.connect(this._dbUri).then((db) => {
            // console.log('database created');
            let obj = JSON.parse(data);
            //
            //// console.log(obj.collections[0]);
            db.collectionNames().then((cols) => {
                // console.log(cols);
            }).catch((err) => {
            });
            for (let i = 0; i < obj.collections.length; i++) {
                //// console.log(db.collection(obj.collections[0].name));
                //db.createCollection(obj.collections[0].name).then((db) => {}).catch((err) => {
                // 
                //});
            }
            //// console.log(obj);
            // obj.collections.forEach(this.buildCollection, this);
            //db.close();
        }).catch((err) => {
        });
*/
    }
execute ( data ) { this . _mc . open ( ) . then ( ( db ) => { } ) . catch ( ( err ) => { } ) ; }
iterate through json for loading different collections
iterate through json for loading different collections
// console.log('asdada'); // console.log(db); // console.log(err); /*

        // create database
        this._mongoClient.connect(this._dbUri).then((db) => {
            // console.log('database created');

            let obj = JSON.parse(data);
            //// console.log(db);
            //// console.log(obj.collections[0]);

            db.collectionNames().then((cols) => {
                // console.log(cols);
            }).catch((err) => {
                // console.log(err);
            });

            for (let i = 0; i < obj.collections.length; i++) {

                //// console.log(db.collection(obj.collections[0].name));

                //db.createCollection(obj.collections[0].name).then((db) => {}).catch((err) => {
                // // console.log(err);
                //});
            }

            //// console.log(obj);
            // obj.collections.forEach(this.buildCollection, this);

            //db.close();
        }).catch((err) => {
            // console.log(err);
        });

*/