Symfony Bundle for DoctrineCouchDB
Failed to load latest commit information.
CacheWarmer Add CacheWarmer for proxy directory Jun 23, 2011
Command missing default value of document manager Dec 14, 2013
DataCollector Add DataCollector for CouchDB Jun 20, 2011
DependencyInjection Add "ssl" option key, closes #44 Dec 14, 2015
Form add couchdb entity loader Oct 28, 2015
Mapping/Driver Updates to use latest Doctrine/common faclities Sep 26, 2012
Resources Updates to use latest Doctrine/common faclities Sep 26, 2012
Tests Add "ssl" option key, closes #44 Dec 14, 2015
Validator/Constraints Added the validator integration Dec 20, 2011
.gitignore Update CouchDB Bundle to latest Symfony gadgets and standalone testing Nov 26, 2011
DoctrineCouchDBBundle.php fix proxy class generating for each request and class name comparing … Nov 27, 2015
ManagerRegistry.php use registerLoader in README May 10, 2013
composer.json Allow symfony 3.0 components Feb 22, 2015

Doctrine CouchDB Bundle

This bundle integrates Doctrine CouchDB ODM and Clients into Symfony2.



  • composer require doctrine/couchdb-odm-bundle
  • Add Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle to your Kernel#registerBundles() method
  • If you do not use composer, do not forget to add autoloader for the Doctrine\CouchDB, Doctrine\ODM\CouchDB and Doctrine\Bundle namespaces

To use the annotations, register them in your app/autoload.php file:

use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));


See the Doctrine CouchDB ODM documentation for more information.


The configuration is similar to Doctrine ORM and MongoDB configuration for Symfony2 as its based on the AbstractDoctrineBundle aswell:

    dbname: symfony
    auto_mapping: true

To dump the configuration reference of this bundle

php app/console config:dump-reference doctrine_couch_db


An example of how to use annotations with CouchDB and Symfony:

namespace Acme\DemoBundle\CouchDocument;

use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;

 * @CouchDB\Document
class User
    /** @CouchDB\Id */
    private $id;


You can access to CouchDB services:


namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
    public function indexAction()
        $client = $this->container->get('doctrine_couchdb.client.default_connection');
        $documentManager = $this->container->get('doctrine_couchdb.odm.default_document_manager');

View directories

In @YourBundle/Resources/couchdb/ you can add design documents and corresponding views and have Doctrine CouchDB register them up automatically. For example if you had a design doc "foo" and a view "bar" you could add the following files and directories:

└── foo/
    └── views/
        └── bar/
            ├── map.js
            └── reduce.js

You can then update this design document from the CLI by calling:

./app/console doctrine:couchdb:update-design-doc foo

Where foo is the name of the design document.