Yii2 And Mongo Relation


How related 2 model as one to Many. My code not work(((

I am try

public function getPages(){

        return $this->hasMany(ManagerPages::className(),['category_id'=>'_id']);


but it not works.

if i write incorect "category_id" as "category_id2" i do not get error

and i now write

return ManagerPages::findAll(['category_id'=>(string)$this->_id]); 

P.S. i use "hasOne" in other model and code works fine))) but with "hasMany" not want.

Hi, can you please report this issue on github? https://github.com/yiisoft/yii2/issues?milestone=4&state=open

Also please explain what exactly does "not work".

"not work"- return empty result