UNPKG

level-up-models

Version:

Models to be use by the backend of the lvlup project

19 lines (16 loc) 628 B
class Common { constructor() { this.models = {}; } init(mongoose) { mongoose.connect('mongodb+srv://admin:admin@cluster0.2mmi2.mongodb.net/LUL?retryWrites=true&w=majority'); require('./models/facilityModel'); //add more model references here //This is just to make referencing the models easier within your apps, so you don't have to use strings. The model name you use here must match the name you used in the schema file this.models = { facilityModel: mongoose.model('facilities') }; } } var common = new Common(); module.exports = common;