I followed meteor/mongodb: Use different DB for authentication & read/write to a T and am receiving the error when trying to query the db:
Exception while invoking method 'myMethod' MongoError: not authorized for query on myDB.bobRocks
I setup the user in Mongo using:
use admin
db.createUser(
{
user: 'bob',
pwd: '12345',
roles: [
{ role: 'readWrite', db: 'myDB'},
]
}
)
My Database call is:
var myDB = new MongoInternals.RemoteCollectionDriver("mongodb://10.10.10.100:27017/myDB");
BobRocks = new Mongo.Collection('bobRocks', { _driver: myDB })
Finally I'm using:
MONGO_URL=mongodb://bob:[email protected]:27017/admin meteor run
What am I missing? I would assume the authentication would follow the MONGO_URL declaration but it doesn't appear to.