1

meteor allows to specify the DB using the env variable MONGO_URL:

"mongodb://user:password@host:port/meteorDB"

Meteor will then automatically use the "meteorDB" database to authenticate against and all collections will refer to this database and read/write to it.

However, I use mongodb cloud manager to setup my users. It saves all users to the admin DB rather than having separate users saved in each database. I would like to use the "admin" DB for authentication and the "meteorDB" for data storage. Is this possible?

1 Answer 1

1

Yep, here's a code snippet of how to tie a collection to a different MongoDB URL:

var db = new MongoInternals.RemoteCollectionDriver("<ONE OF YOUR DBS>");
MyCollection = new Mongo.Collection("<YOUR COLLECTION>", { _driver: db });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.