I followed the instructions here for setting up users...
Then from another machine I do:
mongo -u admin -p adminpassword host/collection
The response I get is:
MongoDB shell version: 2.6.10 connecting to: host/collection 2019-07-12T06:20:36.336+0000 Error: 2 { ok: 0.0, errmsg: "Auth mechanism not specified", code: 2, codeName: "BadValue" } at src/mongo/shell/db.js:1287 exception: login failed
Now, I suppose this is an issue with different versions but what I'm really after is to remote connect from a node script and that's failing as well but the only message is: "MongoError: Authentication failed."
Does anyone know a solution?