PHPackages                             martynbiz/php-mongo - 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. martynbiz/php-mongo

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

martynbiz/php-mongo
===================

PHP ODM for MongoDB.

v0.0.0(9y ago)095MITPHPPHP &gt;=5.3.0

Since May 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/martynbiz/php-mongo)[ Packagist](https://packagist.org/packages/martynbiz/php-mongo)[ Docs](http://github.com/martynbiz/php-mongo)[ RSS](/packages/martynbiz-php-mongo/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Installation
------------

[](#installation)

### Install with composer

[](#install-with-composer)

```
$ composer require martynbiz/php-mongo

```

Getting started
---------------

[](#getting-started)

### Create connection

[](#create-connection)

```
\MartynBiz\Mongo\Connection::getInstance()->init(array(
    'db' => 'mydb',
    'username' => 'myuser',
    'password' => '89dD7HH7di!89',
    'classmap' => array(
        'users' => '\\App\\Model\\User',
    ),
));
```

### Create model

[](#create-model)

Create models by extending the Mongo class, be sure to define $collection and $whitelist:

```
