Connecting Mongodb Atlas from Spring boot

I find the actual problem. In my pevious Atlas password contain @ (symbol) so its not supoort. I follwed document HERE

IMPORTANT If the password contains reserved URI characters, you must escape the characters per RFC 2396. For example, if your password is @bc123, you must escape the @ character when specifying the password in the connection string; i.e. %40bc123.


Failed to instantiate [com.mongodb.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.IllegalArgumentException: The connection string contains invalid user information. If the username or password contains a colon (:) or an at-sign (@) then it must be urlencoded

The problem is crystal clear, if you are trying to connect with MongoDB Atlas with SpringBoot, your password must be URL Encoded which is more secure.

Here you can see how to URL encode password in MongoDB Atlas.