Open nehemiekoffi opened 4 months ago
Query data by including hasmany relation..
// Exemple result = await this.authorRepository.findOne({ where: { id : '<authorId>'}, include:['books'] })
in the result, you will notice that books is undefined for authors who dont have any books.
[ { id : 'xxxx', name : 'abc', # books is undefined }, { id : 'xxxx', name : 'abc', books : [ { id : 'xxxxx', title : 'zzzzz' } ] } ]
Books should return empty array for authors who don't have books. it was like that in loopback 3.
[ { id : 'xxxx', name : 'abc', books : [] #should be like that }, { id : 'xxxx', name : 'abc', books : [ { id : 'xxxxx', title : 'zzzzz' } ] } ]
See Reporting Issues for more tips on writing good issues
Steps to reproduce
Query data by including hasmany relation..
Current Behavior
in the result, you will notice that books is undefined for authors who dont have any books.
Expected Behavior
Books should return empty array for authors who don't have books. it was like that in loopback 3.
Link to reproduction sandbox
Additional information
Related Issues
See Reporting Issues for more tips on writing good issues