0.0
No commit activity in last 3 years
No release in over 3 years
Mince interface library to provide a lightweight MongoDB ORM for Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 2.2
~> 0.9
~> 0.9.0
~> 2.1
~> 2.0
~> 0.7

Runtime

~> 1.5.2
~> 1.5.2
 Project Readme

MinceMongoDb

Travis CI

MinceMongoDb is a ruby ORM to provide a quick way to develop with a MongoDB database in Ruby applications.

It is a database interface that abides to the Mince interface API requirements and is officially supported by Mince.

How to use it

View the Mince Wiki on details on how to use this gem.

Basically -

gem install mince_mongo_db
require 'mince_mongo_db'

interface = MinceMongoDb::Interface
interface.add 'tron_light_cycles', luminating_color: 'red', grid_locked: true, rezzed: false
interface.add 'tron_light_cycles', luminating_color: 'blue', grid_locked: true, rezzed: true
all = interface.find_all('tron_light_cycles') 
  # => <Mongo::Cursor:0x3fccb15d16b0 namespace='mince.tron_light_cycles' @selector={} @cursor_id=>
all.to_a
  # => [{"_id"=>BSON::ObjectId('511af435d20cae9055000001'), "luminating_color"=>"red", "grid_locked"=>true, "rezzed"=>false}, {"_id"=>BSON::ObjectId('511af435d20cae9055000002'), "luminating_color"=>"blue", "grid_locked"=>true, "rezzed"=>true}]
interface.get_for_key_with_value('tron_light_cycles', :luminating_color, 'blue')
  # => {"_id"=>BSON::ObjectId('511af435d20cae9055000002'), "luminating_color"=>"blue", "grid_locked"=>true, "rezzed"=>true}

Change some configs

MinceMongoDb::Config.database_name = 'foo'          # Defaults to 'mince'
MinceMongoDb::Config.database_host = 'db.myapp.com' # Defaults to 'localhsot'
MinceMongoDb::Config.username = 'app_db_user'       # Defaults to none
MinceMongoDb::Config.password = 'passw0rd'          # Defaults to none

# Or

MinceMongoDb::Config.options = {
  database_name: 'foo',
  database_host: 'db.myapp.com',
  username: 'app_db_user',
  password: 'passw0rd'
}

Links

Contribute

This gem is officially supported by Mince, please go there to learn how to contribute.