yilianhudong/diy-yii-mongodb

青岛易联互动网络科技有限公司, 定制使用yii框架

v1.0.0 2020-01-13 02:22 UTC

This package is auto-updated.

Last update: 2024-05-13 11:37:23 UTC


README

This is the core framework code of Yii 2.

This repository is a read-only git subsplit of https://github.com/yiisoft/yii2. Please submit issue reports and pull requests to the main repository. For license information check the LICENSE-file.

Installation

The preferred way to install the Yii framework is through composer.

Either run

composer require yilianhudong/diy-yii-mongodb

or add

"yilianhudong/diy-yii-mongodb": "~1.0.0",

to the require section of your composer.json.

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"
            ]
        ],
    ],
];