Chase Roossin
02/10/2021, 11:54 PMPost
that has relationship to many Likes
- When retrieving many posts... what is the most efficient way to see how many likes its got and if you are on of those likes.
Seems like you would need several queries? Does anyone have an example of the most performant way to do this?Chase Roossin
02/11/2021, 12:29 AMChase Roossin
02/11/2021, 4:19 AMRyan
02/11/2021, 7:07 AMlength
of the items fetched.
There’s an open request here for the same so it would be great if you could add a 👍 so that we can look into the priority for this.Chase Roossin
02/11/2021, 2:17 PMRyan
02/11/2021, 2:23 PMSo in theory, you’d recommend getting the array of posts (including its likes) then iterating through each post, and checking the length of likes and if your user was in that array of likes?This would be different then just getting the count of likes as you would need to likes to fetch the users.