---
title: "Discussion on \"Next JS - MongoDB Connection\" | Hashnode"
description: "Discussion on \"Next JS - MongoDB Connection\". MongoDB is a popular open-source, document-oriented NoSQL database that uses a flexible, JSON-like data model."
url: "https://hashnode.com/posts/next-js-mongodb-connection/6426da911bc71ef1cf980677"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Next JS - MongoDB Connection](https://blog.bosoniqueitedtech.com/next-js-mongodb-connection?utm_source=hashnode&utm_medium=feed)

MongoDB is a popular open-source, document-oriented NoSQL database that uses a flexible, JSON-like data model.

Mar 31, 2023 · 3 min read · blog.bosoniqueitedtech.com  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#mongodb](https://hashnode.com/tag/mongodb)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#postman](https://hashnode.com/tag/postman)
-   [#mongoose](https://hashnode.com/tag/mongoose)

## Written by

[Manas Krishna Jaiswal](https://hashnode.com/@bosoniqueit)

@bosoniqueit · Lucknow, India

  
[View profile](https://hashnode.com/@bosoniqueit)

A AWS Cloud Engineer with a passion for staying on the cutting edge of technology.

As a Full-Stack Developer with a passion for staying on the cutting edge of technology, I bring a unique blend of creativity and technical expertise to every project. With extensive experience in web development, I have built an impressive portfolio of successful projects that range from intuitive user interfaces to complex backend systems. As a AWS DevOps engineer, I am dedicated to optimizing development workflows and reducing costs through automation, cloud computing, and infrastructure management. My ability to work collaboratively and think outside the box make me an asset to any team.

## Responses 2

Markdown supported · ⌘↵ to post

[Hussain Bhagat](https://hashnode.com/@Husain01)

[Apr 25, 2024](https://hashnode.com/posts/next-js-mongodb-connection/6426da911bc71ef1cf980677/comment/662a753306deccab2596b1a3)

Hi Manas, I wanted to know how to connect to multiple clusters? And switch between multiple DBs in a cluster?

[KENNETH](https://hashnode.com/@devkenny)

[Mar 31, 2023](https://hashnode.com/posts/next-js-mongodb-connection/6426da911bc71ef1cf980677/comment/64276cf0af5048c992b6e570)

I am getting the error "Server Error TypeError: Cannot read properties of undefined (reading 'prototype')

This error happened while generating the page. Any console logs will be displayed in the terminal window.

[Manas Krishna Jaiswal](https://hashnode.com/@bosoniqueit)

[Apr 1, 2023](https://hashnode.com/posts/next-js-mongodb-connection/6426da911bc71ef1cf980677/comment/64276cf0af5048c992b6e570#reply-64279aa1318b4dd1473106b3)

Hi, this error generally occurs when env variables are not properly defined. Please do check that once and also provide screent shot of error so that i can go through it.
