Something went wrong. Try again.
Exploring RabbitMQ & Dockerization of a Node.js API
Something went wrong. Try again.
12345678910111213141516171819
const mongoose = require('mongoose');
module.exports = {
connect: () => { mongoose.connect(process.env.MONGO_URL) .then(() => { console.log("--- Connected to MongoDB Local\n"); }).catch((error) => { console.log(error); }); },
collection: (name) => { return mongoose.connection.db.collection(name); }
};