• Jump To … +
    assignment.rb associations.rb basics.rb callbacks.rb composite.rb conversions.rb database.rb index.rb modifiers.rb queries.rb spec.rb validations.rb
  • index.rb

  • ¶

    Object Model for MongoDB.

    basics, composite/embedded, queries/scopes, validations, callbacks, associations, assignment, conversions, modifiers, database, migrations.

    Features:

    • Models are (almost) pure Ruby Objects.
    • Minimum extra abstractions, trying to keep things as close to the MongoDB semantic as possible.
    • Schema-less, dynamic (with ability to specify types for mass-assignment).
    • Models can be saved to any collection, dynamically.
    • Full support for composite / embedded objects (with validations, callbacks, …).
    • Scope, default scope.
    • Doesn’t try to mimic ActiveRecord, MongoDB is differrent and the Object Model designed to get most of it.
    • Works with multiple connections and databases.
    • Support for associations.
    • Same API for Driver and Object Model.
    • Small codebase, see code stats.

    This tool exposes simplicity and power of MongoDB and leverages its differences.

    Install MongoDB Model with Rubygems:

    gem install mongodb_model
    

    The project is hosted on GitHub. You can report bugs and discuss features on the issues page.

    Note: use require 'mongo/model/integration/rails' for Rails integration.