mongoid/moped — pull request #114 by Winslett (2012-11-16 05:48:50+00:00)
Title: Add a URI parser to Moped for ease of use.

I found myself wanting a quick and dirty MongoDB URI methods on Moped.

I didn't know if you wanted to go this route with Moped. I put some code down to parse incoming URIs for Moped. The use case would be something like the following:

> require 'moped'
> session = Moped::Session.connect('mongodb://localhost:27017/my_db')
> session[:users].find.one

Includes support for authentication and for options in the query string, such as:

mongodb://myusername:mypassword@kate.member0.mongohq.com:27017,kate.member1.mongohq.com:27017/winslett-quick-moped-test?consistency=strong&safe=true

No worries if you had different plans for this. I was using Moped solo in a few scenarios, and found this type of method to be useful.