mongo-dart / mongo_dart

Mongo_dart: MongoDB driver for Dart programming language
https://pub.dev/packages/mongo_dart
MIT License
445 stars 98 forks source link

Not opening connection with atlas #383

Open Suebersson opened 1 month ago

Suebersson commented 1 month ago

Captura de tela 2024-08-19 155354

the code stops in the function ==> db.open();

version: 0.10.3

mongodb+srv://userName...>:<password...>@<cluster....mongodb.net/?retryWrites=true&w=majority&appName=...

gloubi-boulga commented 1 month ago

Same problem using Flutter but instead I get this error : image It's like it is trying to take my password as the port.

Version used : 0.10.3

SOLUTION : I had special characters in my password, the mongo_dart package use the Uri.parse method which converts your connection string into an URI, these characters may cause issues during the parsing process because they have specific meanings in a URI.