Plugin::MongoDB

Intergates MongoDB support into LanGrove persistance layer.

gem install langrove-plugin-mongodb

Implements

  • LanGrove::Plugin::Persistor

Supports

  • LanGrove::Behaviour::Persistable
  • LanGrove::Behaviour::Preloadable

Example

Configuring the plugin.



  ...

    :plugins:
        :a_mongodb_collection:
          :class: MongoDB
            :database: database_name
            :table: collection_name
            :key:
              _id: unique_field_name
              #
              # assuming @capsule['unique_field_name'] exists
              #

    ...



  ...

    :server:
        :behavior:
            :persistable:
                :plugin: :a_mongodb_collection
                :at:
                    :handler_after_receive: 
                    #
                    # will default to storing the caspsule 
                    # after the Handler.receive( data )
                    # method returns.
                    #

    ...