Currently, I am working on a project in Next.js called NetMapper where I am developing a web interface for the CLI tool nmap
. My main focus right now is creating Sign In/Sign Up forms and storing user information in MongoDB Compass. Despite trying various tutorials from YouTube, I am facing challenges in establishing a connection to MongoDB Compass. Although I have developed Schemas and Models for users, I am unable to successfully connect to the MongoDB Compass database.
To address this issue, I have installed mongoose.
My attempt so far:
const connectDb = async () => mongoose.connect("mongodb://localhost:27017/netmapper);
What steps should I take next? How can I effectively utilize the Model I created to insert data from the form into the database?