Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cypher query in all() and find() genres.py #26

Open
wants to merge 1 commit into
base: 10-genre-details
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/dao/genres.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_movies(tx):
}
RETURN g {
.*,
movies: size((g)<-[:IN_GENRE]-(:Movie)),
movies: count { (g)<-[:IN_GENRE]-(:Movie) },
poster: poster
} AS genre
ORDER BY g.name ASC
Expand Down Expand Up @@ -72,7 +72,7 @@ def find_genre(tx, name):
WITH g, head(collect(m)) AS movie
RETURN g {
.name,
movies: size((g)<-[:IN_GENRE]-()),
movies: count { (g)<-[:IN_GENRE]-() },
poster: movie.poster
} AS genre
""", name=name).single()
Expand All @@ -87,4 +87,4 @@ def find_genre(tx, name):
with self.driver.session() as session:
# Execute within a Read Transaction
return session.execute_read(find_genre, name)
# end::find[]
# end::find[]