How to connect my Next.js app to MongoDB Compass?

I am doing a Next.js project called NetMapper. Basically, I am creating a web interface for the CLI tool nmap. I am creating a Sign In/Sign Up forms and I need to store users in MongoDB Compass. I tried all sorts of things that I saw from youtube but it doesn’t work. I have created Schema and Model for users but I can’t connect to MongoDB Compass.

I installed mongoose for that

I did:

const connectDb = async () => mongoose.connect("mongodb://localhost:27017/netmapper);

But what do I do next ? How to use the Model that I created and actually insert data from the form in that database ?