You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hello, I am trying to use the entity manager to query for specific fields in the relationship data. In my case I am trying to query for all of the author's books but only want the title values. Right now I am getting both the title and genre values. Can you please assist me in figuring out why this is happening?
One way I can think of doing this is to do 2 separate queries. One to get the author id and then another one to query books for that specific author id. This creates 2 calls to the database which is not ideal.
Describe the bug
Hello, I am trying to use the entity manager to query for specific fields in the relationship data. In my case I am trying to query for all of the author's books but only want the
title
values. Right now I am getting both thetitle
andgenre
values. Can you please assist me in figuring out why this is happening?Author.ts
Book.ts
Code that I am calling:
Expected behavior
I expect only the book
title
values and not thegenre
values.Versions
| Dependency | Version |
| node | v16.13.1 |
| typescript | v4.3.5 |
| mikro-orm | v4.5.9 |
| mongodb | v4.5.9 |
The text was updated successfully, but these errors were encountered: