Hello!
I am trying to connect to my MongoDB database. While doing that I get the infinite request to my DB. I do not know why it happens, but it does not effect to my project directly, but it loads the traffic. I do not know how to stop it. I am using mongoose
library for this purpose and I am working on Next.js.
import mongoose from "mongoose"
const connect = async () => {
try {
await mongoose.connect(process.env.MONGODB_URI)
console.log("MongoDB Connected");
} catch (error) {
console.log(error);
}
}
export default connect;
That is my code, pretty simple. Do you know what can cause such a problem?