despite the many topics (Queries hang when using mongoose.createConnection() vs mongoose.connect() and with unfortunataly a lack of experience I can 't get a working connection with mongoose.createConnection.
Inspired on one of the mentioned linked I started to change my script but without result.
//my db.js
const mongoose = require('mongoose'), db;
db = mongoose.createConnection = ("mongodb://localhost:27017/myApp",
{ "auth": { "authSource": "admin" }, "user": "admin1234", "pass": "abcd" });
require('./profiles');
//profiles.js
const mongoose = require('mongoose');
const logFile = new mongoose.Schema ({});
//etc etc
mongoose.model('Profile', profileSchema);
// routepages index.js
const express = require('express')';
const router = express.Router();
const ctrlProfiles('../controller/profiles');
router
//some routes
module.exports = router;
//controllers profiles.js
const mongoose = require('db'),
const Prof = mongoose.model('Profile');
const profileCreate = function (req,res) {};
module.exports = {
profileCreate
};