Answer the question
In order to leave comments, you need to log in
How to connect mysql and mongodb databases in yii2 at the same time?
Actually, this is the whole question, except perhaps how to use them, for example, crud models and Active Record in Google, I tried to find information, but I didn’t really find it. Links and tsyki are only welcome.
Answer the question
In order to leave comments, you need to log in
'components' => [
'dbMySQL' => [
'class' => '\yii\db\Connection',
'dsn' => 'mysql:...',
'username' => '...',
'password' => '...',
'charset' => 'utf8',
],
'dbMongo' => [
'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://...',
],
],
Yii::$app->dbMySQL->...
Yii::$app->dbMongo->...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question