Query `count` returning the wrong value
Hi everyone! I'm hoping someone can help me understand the
This returns 2 records, which is correct, however, the
count() function better. My goal is to retrieve the count of all records in the join. I have the following query:This returns 2 records, which is correct, however, the
count value is 1. I think something is wrong with my groupBy clause but not sure what. I was getting errors until I add that groupBy clause and the data returned is correct, just the count is wrong. The relationship between users and organizationMemberships is one-to-many. Please let me know if there are any other details I need to share