import mongoose , { mongo , Schema } from "mongoose" ; export function Mongo ( connection ) { return function ( constructor ) { mongoose . connect ( connection , { useNewUrlParser : true } , ( e ) => { if ( e ) { console . log ( `Unable to connect ` + e ) ; } else { console . log ( `Connected to the database` ) ; } } ) ; } ; }