{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2-mongodb/issues/51","labels_url":"https://api.github.com/repos/yiisoft/yii2-mongodb/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2-mongodb/issues/51/comments","events_url":"https://api.github.com/repos/yiisoft/yii2-mongodb/issues/51/events","html_url":"https://github.com/yiisoft/yii2-mongodb/issues/51","id":111683542,"number":51,"title":"Eager loading doesn't work for related data, lazy - does","user":{"login":"Lisio","id":1868244,"avatar_url":"https://avatars.githubusercontent.com/u/1868244?v=3","gravatar_id":"","url":"https://api.github.com/users/Lisio","html_url":"https://github.com/Lisio","followers_url":"https://api.github.com/users/Lisio/followers","following_url":"https://api.github.com/users/Lisio/following{/other_user}","gists_url":"https://api.github.com/users/Lisio/gists{/gist_id}","starred_url":"https://api.github.com/users/Lisio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lisio/subscriptions","organizations_url":"https://api.github.com/users/Lisio/orgs","repos_url":"https://api.github.com/users/Lisio/repos","events_url":"https://api.github.com/users/Lisio/events{/privacy}","received_events_url":"https://api.github.com/users/Lisio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-15T18:53:48Z","updated_at":"2015-10-15T22:34:01Z","closed_at":null,"body":"What could be the misconfiguration of hasMany relation, if it works only with lazy loading?\r\n\r\nSomeObject model has relation declared as following:\r\n```php\r\npublic function getImages()\r\n{\r\n    return $this->hasMany(Image::className(), ['metadata.obj_id' => '_id']);\r\n}\r\n```\r\n\r\nCode in controller:\r\n```php\r\n$data = SomeObject::find()->with('images')->where(['state' => 'active'])->one();\r\nvar_dump($data->images); // Array ( )\r\n$data = SomeObject::find()->where(['state' => 'active'])->one();\r\nvar_dump($data->images); // Array ( [0] => app\\models\\Image Object ( and so on\r\n```"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2-mongodb/issues/comments/148542236","html_url":"https://github.com/yiisoft/yii2-mongodb/issues/51#issuecomment-148542236","issue_url":"https://api.github.com/repos/yiisoft/yii2-mongodb/issues/51","id":148542236,"user":{"login":"Lisio","id":1868244,"avatar_url":"https://avatars.githubusercontent.com/u/1868244?v=3","gravatar_id":"","url":"https://api.github.com/users/Lisio","html_url":"https://github.com/Lisio","followers_url":"https://api.github.com/users/Lisio/followers","following_url":"https://api.github.com/users/Lisio/following{/other_user}","gists_url":"https://api.github.com/users/Lisio/gists{/gist_id}","starred_url":"https://api.github.com/users/Lisio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lisio/subscriptions","organizations_url":"https://api.github.com/users/Lisio/orgs","repos_url":"https://api.github.com/users/Lisio/repos","events_url":"https://api.github.com/users/Lisio/events{/privacy}","received_events_url":"https://api.github.com/users/Lisio/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T22:34:01Z","updated_at":"2015-10-15T22:34:01Z","body":"[Pull request](https://github.com/yiisoft/yii2-mongodb/pull/52)"}}