Is there any tutorial/docs that explain remote MongoDB connections?


#1

I don’t want to use the MongoDB that bundled with Meteor. How can I connect to my local MongoDB?


#2

It’s generally something like:

MONGO_URL=mongodb://localhost:27017 meteor

or

export MONGO_URL=mongodb://localhost:27017 meteor

with authentication:

MONGO_URL="mongodb://username:password@hosturl:27017/test" meteor

Windows:

set MONGO_URL=mongodb://localhost:27017 meteor

#3

Thanks for the answer. But where do I add this?

Also, I see things like MongoInternals.RemoteCollectionDriver in various topics. What is this then?


#4

Either in the shell or a shell script http://www.meteorpedia.com/read/Environment_Variables

It’s used - internally - by Mongo.Collection to determine if the collection is persistent or in-memory (MiniMongo). I’m not sure of any other uses for it.


#5

OK I just use it with the Meteor start command. It’s acceptable for now (I wish I could add it in a config file or something so Meteor could fetch it automatically).

MongoInternals.RemoteCollectionDriver is kind of painful. Meteor connects to it but I think getting the reactivity work is such a hassle. That code works on server only.

MONGO_URL is OK with one database but what if I want to run more than one?
MongoInternals.RemoteCollectionDriver seems the solution for multiple databases but again, it’s hard to make it reactive.

Personal Note: Meteor started to feel like iOS: Too simplified to achieve better ease-of-use.
What I want is OS X experience: Easy-to-use, incredibly powerful once you get to know it. :smile: