I'm trying to connect to a local MongoDB with authentication but failing.
DBClientConnection c;
string errMsg;
c.connect("localhost");
bool success = c.auth("ss1", "admin", "password", errMsg);
auth()
returns always false, and the errMsg is { ok: 0.0, errmsg: "auth failed", code: 18 }
- Without authentication, I can read and write to the DB form the code
- Couldn't find any documentation about the response
Neil Lunn and acm were right. Using the newer version did solve the authentication issue. Thank you