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

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

yuxiang32/yii2-mongodb
======================

Transactions

1.2(5y ago)0144MITPHP

Since Dec 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/shyx32/yii2-mongodb)[ Packagist](https://packagist.org/packages/yuxiang32/yii2-mongodb)[ RSS](/packages/yuxiang32-yii2-mongodb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

 [ ![](https://camo.githubusercontent.com/b03378e6893070fd365e1c95eb6553933577a14cbf0837c31b16bb6f25783efb/68747470733a2f2f7765626173736574732e6d6f6e676f64622e636f6d2f5f636f6d5f6173736574732f636d732f6d6f6e676f64622d6c6f676f2d7267622d6a36773237316731786e2e6a7067) ](https://www.mongodb.com/)

MongoDB Extension for Yii 2
===========================

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

This extension provides the [MongoDB](https://www.mongodb.com/) 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://github.com/yiisoft/yii2-mongodb/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-mongodb/actions)

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

[](#installation)

This extension requires [MongoDB PHP Extension](http://us1.php.net/manual/en/set.mongodb.php) version 1.0.0 or higher.

This extension requires MongoDB server version 3.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.1.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://localhost:27017/mydatabase',
            'options' => [
                "username" => "Username",
                "password" => "Password"
            ]
        ],
    ],
];
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

3

Last Release

1968d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c21db421781befee5f18f2d483611400122c1d080a09ecb1cd5a98e34ee9730?d=identicon)[shyx32](/maintainers/shyx32)

---

Top Contributors

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

### Embed Badge

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

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

###  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.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

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

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/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)
