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

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

joorloohuis/yii2-mongodb
========================

Yii2 component that provides a wrapper for the official mongodb.org client

v2.0.1(3y ago)010.5k1MITPHPPHP &gt;=7.0

Since Feb 28Pushed 3y ago1 watchersCompare

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

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

yii2-mongodb
============

[](#yii2-mongodb)

MongoClient exposes official MongoDB support as provided by mongodb.org in the form of a Yii2 component. This component provides a MongoDB\\Client object, and as such may be used exactly as documented in [the official MongoDB referece](https://docs.mongodb.com/php-library/).

The reason behind the existence of this component is that the standard Yii2 component caters to the AR approach, and this shields a lot of the powerful core functionality provided by the MongoDB PHP Library provided by mongodb.org.

This component requires the newer mongodb PHP extension, the old mongo PHP extension is untested and unsupported.

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

[](#installation)

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

Either run

```
php composer.phar require joorloohuis/yii2-mongodb
```

or add

```
"joorloohuis/yii2-mongodb": "^1.0.0"
```

to the require section of your `composer.json` file.

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

[](#configuration)

Add the following section to the `components` part of your configuration:

```
