Monday, December 16, 2013

Scala/MongoDB Recipe: Extract connection info from MongoDB URI with regex

I am deploying a Scala app on Heroku with MongoLab addon which means my MongoDB connection URI will be exposed as a system variable. Unfortunately I am using ReactiveMongo and as far as I can tell there is no way to create a connection using a URI. So I need to chop the URI into its component parts. Here is the regex I used:

No comments:

Post a Comment