0

I am having trouble with correct format of authenticating code. According to http://mongoc.org/libmongoc/current/authentication.html, authenticate code is

mongoc_client_t *client = mongoc_client_new ("mongodb://user:password@localhost/?authSource=mydb");

And i have following code but it doesnt work:

client = mongoc_client_new ("mongodb://myuser:abcdefghjk@27.235.114.154/?authSource=books");

what should be the correct format to access db on server?

dome some
  • 479
  • 7
  • 22

0 Answers0