PHPackages                             serebro/reach-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. serebro/reach-mongo

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

serebro/reach-mongo
===================

MongoDB ODM

0.9(11y ago)121331MITPHPPHP &gt;=5.4.0

Since Dec 16Pushed 10y ago4 watchersCompare

[ Source](https://github.com/serebro/reach-mongo)[ Packagist](https://packagist.org/packages/serebro/reach-mongo)[ RSS](/packages/serebro-reach-mongo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Reach - PHP MongoDB ODM
=======================

[](#reach---php-mongodb-odm)

[![Total Downloads](https://camo.githubusercontent.com/11bf75f4675b5992a9222d7b710501279974097ff6fe816882db866ab4916b26/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7365726562726f2f72656163682d6d6f6e676f2e7376673f7374796c653d666c6174)](https://packagist.org/packages/serebro/reach-mongo)[![Build Status](https://camo.githubusercontent.com/30512dfbfac86f13ab577443bb764ec32fb88116e3b3eac9565363e74326c0db/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f7365726562726f2f72656163682d6d6f6e676f2e7376673f7374796c653d666c6174)](https://travis-ci.org/serebro/reach-mongo)[![Code Coverage](https://camo.githubusercontent.com/e6dd6a2661c6602ebe682240ed56d137632f659ceca28870c3104380410efe6f/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f7365726562726f2f72656163682d6d6f6e676f2e7376673f7374796c653d666c6174)](https://coveralls.io/r/serebro/reach-mongo)[![License](https://camo.githubusercontent.com/14d3ebf589c4e36c3f6eabe10c5bc3723bfd416a0d5d86101b11bb67338d4f3b/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7365726562726f2f72656163682d6d6f6e676f2e7376673f7374796c653d666c6174)](https://packagist.org/packages/serebro/reach-mongo)

Requirements
------------

[](#requirements)

- PHP &gt;= 5.4;
- ext-mongo &gt;= 1.5

The key feature list:
---------------------

[](#the-key-feature-list)

- Simple, Powerful, Ultrafast
- Support of schema-less documents
- **Ability to use efficient result set iterator instead of raw arrays of results**
- Lazy loading/creating of documents
- Support for partial loading of documents from DB
- **Unit of work (Reduce the number of database requests/updates. Prevent redundant requests and multiple updates to the same document)**
- References and embeds
- Events (system: `before*()` , `after*()` ; custom: `on()` , `off()` , `trigger()` )
- Query builder
- Extensions: Reach can be customized infinitely with behaviours.
- Creating an auto-incrementing sequence field
- Batch inserting, Pagination, Logging
- Integration with IDEs

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

[](#installation)

```
{
    "require": {
        "serebro/reach-mongo": "dev-master"
    }
}
```

```
$config = [
	'class'    => '\Reach\Mongo\Connection'
	'database' => 'testing',
	'host'     => 'localhost',
	'port'     => 27017,
];

\Reach\Service\Container::register('mongo', $config);
```

Basic usage
-----------

[](#basic-usage)

```
