PHPackages                             crodas/activemongo2 - 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. crodas/activemongo2

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

crodas/activemongo2
===================

Mongo abstraction

v0.7.2(9y ago)71.5k↓100%BSD-4-ClausePHPPHP &gt;=5.4.0

Since Aug 1Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (7)Versions (75)Used By (0)

ActiveMongo2 [![Build Status](https://camo.githubusercontent.com/bc66d0804a8c6ad985f361883834069f435e3ed7a108cc67c9f8d161e91c59c7/68747470733a2f2f7472617669732d63692e6f72672f63726f6461732f4163746976654d6f6e676f322e706e673f6272616e63683d646576656c6f70)](https://travis-ci.org/crodas/ActiveMongo2) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/0c5ceb5fd0a2425421382a780744c895f4a3a4b9fe2fe63f5a8b2774cbbfde4d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63726f6461732f4163746976654d6f6e676f322f6261646765732f7175616c6974792d73636f72652e706e673f733d31613432643862323965393739343561376434323733386136333366343861326565636333316630)](https://scrutinizer-ci.com/g/crodas/ActiveMongo2/)
=======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#activemongo2--)

ActiveMongo2 is a very simple, efficient and developer friendly PHP abstraction for MongoDB.

*This is a work in progress, but it is being used already in production at some sites.*

How does it work?
-----------------

[](#how-does-it-work)

`ActiveMongo2` is not backward compatible with [ActiveMongo](https://github.com/crodas/ActiveMongo). `ActiveMongo2` generates code to avoid doing any checks at run time. Therefore configuration is a bit more complicated.

```
// /tmp/mapper.php would be generated
$conf = new \ActiveMongo2\Configuration("/tmp/mapper.php");
$conf->addModelPath(__DIR__ . "/app/model");
$conf->development(); // remove this line at production

// create mongodb connection
$mongo = new \MongoClient;

// create the ActiveMongo2 connection
$conn  = new \ActiveMongo2\Connection($conf, $mongo, 'database');
```

This configuration would walk checking each `*.php` file inside `__DIR__ . "/app/model"`, it would be looking for `@Persist` annotation.

The `ActiveMongo2\Connection` provides several methods, the most useful is `->getCollection("collection_name")`.

TODO
====

[](#todo)

1. Write docs

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~76 days

Total

54

Last Release

3513d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36463?v=4)[C](/maintainers/crodas)[@crodas](https://github.com/crodas)

---

Top Contributors

[![crodas](https://avatars.githubusercontent.com/u/36463?v=4)](https://github.com/crodas "crodas (737 commits)")

### Embed Badge

![Health badge](/badges/crodas-activemongo2/health.svg)

```
[![Health](https://phpackages.com/badges/crodas-activemongo2/health.svg)](https://phpackages.com/packages/crodas-activemongo2)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M208](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
