0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Connect to a Mongo database using the given URI if it is not blank, or else a default collection on the local Mongo.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.8.2
~> 1.6
 Project Readme

Mongo Connector

A simple gem for connecting to Mongo databases.

Build Status

The Mongo Connector takes the URI you give it and connects to the database the URI describes. If the URI is blank, MHQC will try to connect to a database you name on a local Mongo instance.

Usage

Gemfile:

gem 'mongo_connector'

Shell:

gem install mongo_connector

Code:

require 'mongo_connector'

db = MongoConnector.new(ENV['MONGOHQ_URL'], 'my_database').connection

collection = db['my_collection']