PHPackages                             hardsetting/yii2-mongodb - 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. hardsetting/yii2-mongodb

ActiveYii2-extension[Database &amp; ORM](/categories/database)

hardsetting/yii2-mongodb
========================

MongoDb extension for the Yii framework

2.0.6(10y ago)44.5k4BSD-3-ClausePHP

Since Apr 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/hardsetting/yii2-mongodb)[ Packagist](https://packagist.org/packages/hardsetting/yii2-mongodb)[ RSS](/packages/hardsetting-yii2-mongodb/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (11)Used By (0)

MongoDb Extension for Yii 2
===========================

[](#mongodb-extension-for-yii-2)

This extension provides the [MongoDB](http://www.mongodb.org/) integration for the [Yii framework 2.0](http://www.yiiframework.com).

For license information check the [LICENSE](LICENSE.md)-file.

Documentation is at [docs/guide/README.md](docs/guide/README.md).

[![Latest Stable Version](https://camo.githubusercontent.com/1e4b64f510518e5214cd6019c965719418935b8d273e9bcf2c184434e36b8b5f/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d6d6f6e676f64622f762f737461626c652e706e67)](https://packagist.org/packages/yiisoft/yii2-mongodb)[![Total Downloads](https://camo.githubusercontent.com/fbb78cfc2ecd836afc5cb388d357546b77a0d8a0dcbeb6eb3e942e0f6986b934/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d6d6f6e676f64622f646f776e6c6f6164732e706e67)](https://packagist.org/packages/yiisoft/yii2-mongodb)[![Build Status](https://camo.githubusercontent.com/e8a53fc359ddfb986aedb54b81d5292f3d0d15a652cad8d038c702865efe203a/68747470733a2f2f7472617669732d63692e6f72672f796969736f66742f796969322d6d6f6e676f64622e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yiisoft/yii2-mongodb)

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

[](#installation)

This extension requires [MongoDB PHP Extension](http://us1.php.net/manual/en/book.mongo.php) version 1.5.0 or higher.

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yiisoft/yii2-mongodb

```

or add

```
"yiisoft/yii2-mongodb": "~2.0.0"

```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

To use this extension, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'mongodb' => [
            'class' => '\yii\mongodb\Connection',
            'dsn' => 'mongodb://developer:password@localhost:27017/mydatabase',
        ],
    ],
];
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~80 days

Recently: every ~92 days

Total

9

Last Release

3770d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb3f33f9a590ecd9f9ed475240a02a29fad8f618498d22c5dbbec5a164d14a5d?d=identicon)[hardsetting](/maintainers/hardsetting)

---

Top Contributors

[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (1913 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (751 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (639 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (393 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (148 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (123 commits)")[![Ragazzo](https://avatars.githubusercontent.com/u/1748844?v=4)](https://github.com/Ragazzo "Ragazzo (76 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (44 commits)")[![suralc](https://avatars.githubusercontent.com/u/730039?v=4)](https://github.com/suralc "suralc (42 commits)")[![pmoust](https://avatars.githubusercontent.com/u/2493339?v=4)](https://github.com/pmoust "pmoust (36 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (26 commits)")[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (20 commits)")[![LarryUllman](https://avatars.githubusercontent.com/u/1674823?v=4)](https://github.com/LarryUllman "LarryUllman (18 commits)")[![hardsetting](https://avatars.githubusercontent.com/u/7707719?v=4)](https://github.com/hardsetting "hardsetting (17 commits)")[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (16 commits)")[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (13 commits)")[![tarasio](https://avatars.githubusercontent.com/u/1010578?v=4)](https://github.com/tarasio "tarasio (12 commits)")[![bwoester](https://avatars.githubusercontent.com/u/309565?v=4)](https://github.com/bwoester "bwoester (12 commits)")[![crtlib](https://avatars.githubusercontent.com/u/4428231?v=4)](https://github.com/crtlib "crtlib (12 commits)")[![gevik](https://avatars.githubusercontent.com/u/434535?v=4)](https://github.com/gevik "gevik (10 commits)")

---

Tags

mongodbyii2active-recordmongo

### Embed Badge

![Health badge](/badges/hardsetting-yii2-mongodb/health.svg)

```
[![Health](https://phpackages.com/badges/hardsetting-yii2-mongodb/health.svg)](https://phpackages.com/packages/hardsetting-yii2-mongodb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[yiisoft/yii2-mongodb

MongoDB extension for the Yii framework

3312.1M45](/packages/yiisoft-yii2-mongodb)[leroy-merlin-br/mongolid

Easy, powerful and ultrafast ODM for PHP and MongoDB.

11234.3k4](/packages/leroy-merlin-br-mongolid)[moloquent/moloquent

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

120114.6k7](/packages/moloquent-moloquent)

PHPackages © 2026

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