fix: query to get only distinct favPost

This commit is contained in:
SoXX 2024-02-16 23:44:33 +01:00
parent 669bea7753
commit 7fdc5d15c7

View File

@ -63,7 +63,7 @@ func GetUserFavoritesCount(ctx context.Context, driver neo4j.DriverWithContext,
MATCH (userNode:User {user_id: $anthrove_user_id})
MATCH (userNode)-[:FAV]->(favPost:AnthrovePost)
MATCH (sourceNode)-[:REFERENCE]->(favPost)
RETURN count(favPost) AS FavoritePostsCount
RETURN count( DISTINCT favPost) AS FavoritePostsCount
`
params := map[string]any{