B4J Question [SOLVED],[BANAnoVuetifyAD3] , Can not connect to MongoDB with User name and Password

NGUYEN TUAN ANH

Active Member
Licensed User
Dear All,
I have set up on MongoDB to require User name and Password to connect to
But in my source code there is only:
B4X:
Dim mongo As BANanoMongoDB
mongo.Initialize(Main.Host, Main.DbPort, Main.Database, "Table1")
And of course the above command will fail because it can't connect to MongoDB
Please show me how to add User name and Password to connect to my MongoDB
Thank you very much
I'm waiting for you
Best regards
 

NGUYEN TUAN ANH

Active Member
Licensed User
Very simple, I have successfully connected by adding UserName:MyPassword@ in front of Host ip
Example: Public Host As String = "myname:mypassword@103.169.75.102"
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…