Uploading Images with GridFs. Am I doing this right?

After days of trying to figure out how to store images using GridFS. I came across Brad Traversy tutorial on how to do just that. The real issue was how to combine that with other user data when submitting a form.

Right now I have a model that looks like this.

const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const personSchema = Schema({
  name: String,
  image: String,

const Person = mongoose.model("Person", personSchema);

module.exports = Person;

Following Brads tutorial which can be found here https://www.youtube.com/watch?v=3f5Q9wDePzY

I would also like to correlate the image being uploaded with my mongoose model. For some reason it seems to need a separate connection when creating documents then when an image is being loaded. Here is how I managed to correlate the two.

app.post("/upload", upload.single("file"), async (req, res) => {
  const { filename } = req.file || "";

  const saveInDB = await personController.create(rew.body.name, req.file.filename);

Person controller lives in a separate directory. This is the code inside my controller directory.

const Person = require("../model/user");
const mongoose = require("mongoose");

const conn = mongoose.connect(
  process.env.MONGODB_URI || "mongodb://localhost/imageInfo"
// Defining methods for the booksController
module.exports = {
  findAll: async function (req, res) {
    n = await Person.find()
    return n;

  create: async function (name = "cesar", image) {
    const l = await Person.create({ name, image })

    return l;

To actually save the images in mongo it seems to need its own connection which I have at the top of my app.js file.

// Mongo URI
const mongoURI = "mongodb://localhost/imageInfo";

// Create mongo connection
const conn = mongoose.createConnection(mongoURI);

So my main question is why does it need 2 separate connections even though they point to the same place. I tried it with just one connection and it timed out.