plansky/mongolid-bundle

Easy, powerful and ultrafast MongoDB ODM Bundle for Symfony.

v0.1-beta 2014-08-12 03:00 UTC

This package is not auto-updated.

Last update: 2024-12-17 04:47:07 UTC


README

MongoLid

MongoLid Bundle for Symfony

MongoLid is an easy, powerful and ultrafast MongoDB ODM. You can see more information in the MongoLid Laravel Package

Getting Started

Installation

Add "plansky/mongolid-bundle": "dev-master" to "require" key in composer.json

"require": {
    ...
    "plansky/mongolid-bundle": "dev-master"
}

Run composer update plansky/mongolid-bundle

Bundle Registration

Register MongolidBundle in AppKernel class

$bundles = array(
    ...
    new Plansky\MongolidBundle\MongolidBundle(),
);

Configure MongoDB Connection

Edit app/config/config.yml file adding the MongoDB connection

mongolid:
    connections:
        default:
            hostname: 'localhost'
            port: 27017
            username: null
            password: null
            database: 'mongolid'

Extends BaseDocument

To start using MongoLid just extends Plansky\MongolidBundle\Document\BaseDocument

class MyDocument extends \Plansky\MongolidBundle\Document\BaseDocument
{
    /**
     * Collection's that will be used to persist my document
     * @var string
     */
    protected $collection = 'my_collection';
}

Enjoy =)

License

MIT

Resources