Problem Statement : My project data is stored in mysql database but due to huge amount of data i want to use mysql with mongodb. I have a sql table named as ‘xyz’ and mongodb collection named as ‘abc’ each ‘abc’ is specific to ‘xyz’. how can i connect these two entities with hasMany() relation? I am using php framework yii2
Asked
Active
Viewed 78 times
0
-
1what framework are you using to build your application, thats the only way someone can tell if the ORM has a support for " hasMany ", i know laravel has it, but your question doesnt specify. – Ande Caleb Feb 28 '22 at 12:05
-
I am using yii2 – Syeda Warda Naqvi Feb 28 '22 at 12:06
-
i hope this helps, saw a quite similar post here. https://stackoverflow.com/questions/29347016/yii2-active-record-how-create-relation-between-mongo-models – Ande Caleb Feb 28 '22 at 12:08
-
@AndeCaleb thank you for your response but i already read this post. I want to create relation between two models where one model is based on mysql database and other is based on mongodb – Syeda Warda Naqvi Feb 28 '22 at 12:11
-
Looks at [this](https://stackoverflow.com/questions/36419024/yii2-creating-relations-in-models-between-tables-from-2-databases). May be it helps you – Leenard Mar 01 '22 at 05:47