MongoParseError
Node.jsMongoDriverErrorconfigurationconnectivity
The connection string or URI options could not be parsed
What is happening?
MongoParseError is thrown when the MongoClient cannot parse the provided connection string. This happens during client initialization, before any connection attempt.
Common causes
- Malformed mongodb:// or mongodb+srv:// URI
- Unescaped special characters in username or password
- Invalid query parameter in the connection string
- Missing host or port
- Using mongodb+srv:// with a port number (not allowed)