plansky/mongolid-bundle

Easy, powerful and ultrafast MongoDB ODM Bundle for Symfony.

Installs: 4

Dependents: 0

Watchers: 1

Open Issues: 1

Language: PHP

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

README

MongoLid

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