Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prisma - The provided database string is invalid. MongoDB connection string error

I'm being told I have an invalid connection string for my MongoDB data provider.

Specifically, I'm getting this: The provided database string is invalid. MongoDB connection string error: Missing delimiting slash between hosts and options in database URL.

My problem, however, is that my connection string does have a delimiting slash: it's this: mongodb://<user>:<pass>@cluster0.<server>.mongodb.net/?retryWrites=true&w=majority

What's going on? Is there anything I'm missing?

like image 305
Auxilor Avatar asked Mar 19 '26 16:03

Auxilor


1 Answers

It's missing database name after host: mongodb://<user>:<pass>@cluster0.<server>.mongodb.net/<mydb>?retryWrites=true&w=majority

like image 71
Mikhael Abdallah Avatar answered Mar 22 '26 06:03

Mikhael Abdallah