<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨 HELP US HELP YOU, PLEASE - Do a quick search to avoid duplicate issues - Provide as much information as possible (reproduction sandbox, use case for features, etc.) - Consider using a more suitable venue for questions such as Stack Overflow, Gitter, etc. Please fill in the *entire* template below. --> ## Steps to reproduce <!-- Describe how to reproduce the issue --> Query data by including hasmany relation.. ```ts // Exemple result = await this.authorRepository.findOne({ where: { id : '<authorId>'}, include:['books'] }) ``` ## Current Behavior <!-- Describe the observed result --> in the result, you will notice that books is undefined for authors who dont have any books. ```yaml [ { id : 'xxxx', name : 'abc', # books is undefined }, { id : 'xxxx', name : 'abc', books : [ { id : 'xxxxx', title : 'zzzzz' } ] } ] ``` ## Expected Behavior <!-- Describe what did you expect instead, what is the desired outcome? --> Books should return empty array for authors who don't have books. it was like that in loopback 3. ```yaml [ { id : 'xxxx', name : 'abc', books : [] #should be like that }, { id : 'xxxx', name : 'abc', books : [ { id : 'xxxxx', title : 'zzzzz' } ] } ] ``` ## Link to reproduction sandbox <!-- See https://loopback.io/doc/en/contrib/Reporting-issues.html#loopback-3x-bugs --> ## Additional information <!-- Copy+paste the output of these two commands: node -e 'console.log(process.platform, process.arch, process.versions.node)' npm ls --prod --depth 0 | grep loopback --> ## Related Issues <!-- Did you find other bugs that looked similar? --> _See [Reporting Issues](http://loopback.io/doc/en/contrib/Reporting-issues.html) for more tips on writing good issues_