PHPackages                             jpc/mongodb-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. jpc/mongodb-odm

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

jpc/mongodb-odm
===============

A small MongoDB ODM

1.3.1(7y ago)527.5k1MITPHPPHP &gt;=5.5CI failing

Since Oct 4Pushed 3y ago4 watchersCompare

[ Source](https://github.com/JoffreyPoreeCoding/MongoDB-ODM)[ Packagist](https://packagist.org/packages/jpc/mongodb-odm)[ Docs](https://github.com/JoffreyPoreeCoding/MongoDB-ODM)[ RSS](/packages/jpc-mongodb-odm/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (5)Versions (23)Used By (0)

MongoDB-ODM
===========

[](#mongodb-odm)

JPC\\MongoDB-ODM is a smart MongoDB-PHP mappers. It lets you to get your Object in PHP mapped into document in MongoDB. This library support last driver of mongodb available [here](https://pecl.php.net/package/mongodb).

See 'doc' folder for more details.

Install
=======

[](#install)

Install With Composer
---------------------

[](#install-with-composer)

In your console terminal :

```
php composer.phar require jpc/mongodb-odm:^1.3
```

Or in your `composer.json` :

```
{
    "require" : {
        "jpc/mongodb-odm" : "^1.3"
    }
}
```

Create Mapping Class
====================

[](#create-mapping-class)

Your class
----------

[](#your-class)

To work with MongoDB-ODM, you need to see your class like a mongoDb document and define what you need :

- an id
- somes fields

You can create a simple object like this

```
