Implementing serialization of the passport help

i am slowly losing my way in the building of the engine part of advanced node and express.

i am supposed to connect to my database and when i look at the metrics on mongo, it shows what i think is connections happening but my app is rendering that it is not connected. i know before i had trouble and fixed it using old mongo URI connection for older versions but that isnt helping this time.

I think it is connecting but i think something else isnt working. Right now i have it trying to connect to a black database called ‘serializerproject’ with a ‘database1’ with a collection ‘users’. not sure if i was supposed to do any of that.

this is my repl

'use strict';
require('dotenv').config();
const express = require('express');
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const passport = require('passport');
const session = require('express-session');
const ObjectID = require('mongodb').ObjectID;

const app = express();
app.set('view engine', 'pug')
fccTesting(app); //For FCC testing purposes
app.use('/public', express.static(process.cwd() + '/public'));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(session({
  secret: process.env.SESSION_SECRET,
  resave: true,
  saveUninitialized: true,
  cookie: { secure: false }
}));
app.use(passport.initialize());
app.use(passport.session());


myDB(async (client)=>{
  const myDataBase = await client.db('database1').collection('users')

app.route('/').get((req, res) => {
  res.render('pug', {title: 'Connected', message: 'Please login'});
});

passport.serializeUser((user, done)=>{
  done(null, user._id)
})


passport.deserializeUser((id, done) => {
  myDataBase.findOne({ _id: new ObjectID(id) }, (err, doc) => {
    done(null, doc);
  });
});

}).catch((e) => {
  app.route('/').get((req, res) => {
    res.render('pug', { title: e, message: 'Unable to login'});
  });
});


const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log('Listening on port ' + PORT);
});

You have to use the exact title the challenge is asking for in res.render

“Connected to Database”

im such a moron.

thank you

i literally just finished the chapter about how testing works too.