Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Yii 2 MongoDB extension

License

NotificationsYou must be signed in to change notification settings

yiisoft/yii2-mongodb

MongoDB Extension for Yii 2


This extension provides theMongoDB integration for theYii framework 2.0.

For license information check theLICENSE-file.

Documentation is atdocs/guide/README.md.

Latest Stable VersionTotal DownloadsBuild Statuscodecov

Requirements

  • PHP 7.3 or higher.

Installation

This extension requiresMongoDB PHP Extension version 1.20.1 or higher.

This extension requires MongoDB server version 4.0 or higher.

The preferred way to install this extension is throughcomposer.

Either run

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

or add

"yiisoft/yii2-mongodb": "~3.0.0"

to therequire section of yourcomposer.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"            ]        ],    ],];

Known issues

  • yii\mongodb\Exception: no such command: 'group' with MongoDB server version 4.2 or higher.
    Starting in version 4.2, MongoDB removes the group command (deprecated since version 3.4) and its mongo shell helper db.collection.group().

About

Yii 2 MongoDB extension

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors96

Languages


[8]ページ先頭

©2009-2025 Movatter.jp