I'm trying to write a script that copys my heroku db to my local db (mongodb), but I dont have a clue what kind of url format this is:
mongodb://<username>:<password>@lamppost.5.mongolayer.com:10049,lamppost.4.mongolayer.com:10049/<appname>
Why are there two urls, comma separated? Does anyone have a working script to share? :)
The format is a MongoDB Connection String URI for a replica set.
The two hosts listed are members of the replica set provided as a "seed list" for connecting to your MongoHQ instance. Specifying more than one member of the replica set allows for failover -- the MongoDB driver will attempt to connect to the first available member of the seed list in order to discover the current configuration of a replica set.
You can use this URI to connect from Ruby via MongoClient.from_uri(uri)
.