I'm currently learning MongoDB, and I'm trying to connect to my database by MongoDB ATLAS but I'm getting trouble which I couldn't yet connect to it
here is the code:
mongoose.connect('mongodb+srv://anis:anisninis@cluster.mongodb.net/',
{
dbName: 'testDB',
useNewUrlParser: true,
useUnifiedTopology: true
})
.then(() => console.log('Connexion à MongoDB réussie !'))//you are connected
.catch(() => console.log('Connexion à MongoDB échouée !'));// you aren't
the output: you are not connected to MongoDB