PHPackages                             effiana/doctrine-json-odm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. effiana/doctrine-json-odm

ActiveLibrary[Database &amp; ORM](/categories/database)

effiana/doctrine-json-odm
=========================

An object document mapper for Doctrine ORM using JSON types of modern RDBMS.

00PHP

Since Jan 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Effiana/DoctrineJsonODM)[ Packagist](https://packagist.org/packages/effiana/doctrine-json-odm)[ RSS](/packages/effiana-doctrine-json-odm/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Doctrine JSON ODM
=================

[](#doctrine-json-odm)

An Object-Document Mapper (ODM) for [Doctrine ORM](http://www.doctrine-project.org/projects/orm.html) leveraging new JSON types of modern RDBMS.

[![Build Status](https://camo.githubusercontent.com/fd03b42d46d49fbfa2cf66df6f2090cf55be6ea569a3cc9fbe4eb6c81cdf2a48/68747470733a2f2f7472617669732d63692e6f72672f64756e676c61732f646f637472696e652d6a736f6e2d6f646d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dunglas/doctrine-json-odm)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b70ced811fc263d01f49522e768a4678ad4c3969ae8670e95d492a493cd9fb77/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64756e676c61732f646f637472696e652d6a736f6e2d6f646d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dunglas/doctrine-json-odm/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/c25bb18cf676d912624d9e66abdc6b1e7f19bd52fae9aee53a8913563d31e320/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32306366393135622d313535342d346638392d383737322d6566306639313365633735392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/20cf915b-1554-4f89-8772-ef0f913ec759)[![StyleCI](https://camo.githubusercontent.com/62103cb170d9005db18fc52245e67b98710cdb091fa8f804c8f5328f4457314e/68747470733a2f2f7374796c6563692e696f2f7265706f732f35373232333832362f736869656c64)](https://styleci.io/repos/57223826)

Did you ever dreamed of a tool creating powerful data models mixing traditional efficient relational mappings with modern schema-less and NoSQL-like ones?

With Doctrine JSON ODM, it's now possible to create and query such hybrid data models with ease. Thanks to [modern JSON types of RDBMS](http://www.postgresql.org/docs/current/static/datatype-json.html), querying schema-less documents is easy, powerful and [fast as hell (similar in performance to a MongoDB database)](http://www.enterprisedb.com/postgres-plus-edb-blog/marc-linster/postgres-outperforms-mongodb-and-ushers-new-developer-reality)! You can even [define indexes](http://www.postgresql.org/docs/current/static/datatype-json.html#JSON-INDEXING) for those documents.

Doctrine JSON ODM allows to store PHP objects as JSON documents in modern dynamic columns of RDBMS. It works with JSON and JSONB columns of PostgreSQL (&gt;= 9.4) and the JSON column of MySQL (&gt;= 5.7.8).

For more information about concepts behind Doctrine JSON ODM, take a look at [the presentation given by Benjamin Eberlei at Symfony Catalunya 2016](https://qafoo.com/resources/presentations/symfony_catalunya_2016/doctrine_orm_and_nosql.html).

Install
-------

[](#install)

To install the library, use [Composer](https://getcomposer.org/), the PHP package manager:

```
composer require dunglas/doctrine-json-odm

```

If you are using [Symfony 4+](https://symfony.com) or [API Platform](https://api-platform.com), you have nothing more to do! If you use Doctrine directly, use a bootstrap code similar to the following:

```
