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
Unfortunately we had not explored MongoDB PHP with a username and password in all our previous examples.

You can explore the BANanoMongoDB class code, there is PHP code in it, perhaps you can crack it. Keep me posted too, I will see how I can make it work also sometime next week.
Very simple, I have successfully connected by adding UserName:MyPassword@ in front of Host ip
Example: Public Host As String = "myname:[email protected]"
 
Upvote 0
Top