Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Document Mapper based on CouchDB
Failed to load latest commit information.
bin Added the couchdb:odm:generate-proxies command with the necessary hel…
lib Implemented shorthand version for version field mapping
sandbox Fix an inconsistency in the Factory/Bootstrap API with CouchDBClient,…
tests Implemented shorthand version for version field mapping
.gitignore ignore .idea dir from phpstorm
.gitmodules Add YAML Support and tests
.travis.yml Run tests on more current PHP versions, too
LICENSE Changed License from LGPL to MIT
README.markdown Update Documentation link
UPGRADE Prepare for first alpha release
build.xml Gah, Small fixes in build.xml
composer.json Require doctrine/instantiator
composer.lock Require doctrine/instantiator
phpunit.xml.dist First milestone reworking annotations for CouchDB



Build Status Scrutinizer Quality Score

Doctrine CouchDB is a mapper between PHP and CouchDB documents. It uses a metadata mapping pattern to map the documents to plain old php objects, no ActiveRecord pattern or base class of any kind is necessary.

Metadata mapping can be done through annotations, xml, yaml or php. A sample PHP object that is mapped to CouchDB with annotations looks like this:

 * @Document
class Article
    /** @Id */
    private $id;

     * @Field(type="string")
    private $topic;

     * @Field(type="string")
    private $text;

     * @ReferenceOne(targetDocument="User")
    private $author;

    // a bunch of setters and getters

A simple workflow with this document looks like:

$article = new Article();
$article->setTopic("Doctrine CouchDB");
$article->setAuthor(new Author("beberlei"));

// creating the document

$article = $dm->find("Article", 1234);
$article->setText("Documentation, and more documentation!");

// update the document

// removing the document

You can play around with the sandbox shipped in the sandbox/ folder of every git checkout or read the documentation at

Something went wrong with that request. Please try again.