I am getting the below error when trying to connect using moongoose.
MongooseError: You can not mongoose.connect() multiple times while connected.
throw new _mongoose.Error('You can not mongoose.connect() multiple times while connected.');
^
MongooseError: You can not mongoose.connect() multiple times while connected.
at new MongooseError (/node_modules/mongoose/lib/error/mongooseError.js:10:11)
Please help me find the cause for this and how to prevent it