Complete the code block below by identifying the correct method for executing a Cypher statement in a read transaction.
Complete the Code block
Use the dropdown to select the correct method for reading data from Neo4j.
go
personNode, err := /*select:neo4j.ExecuteRead*/[neo4j.Node](
ctx,
session,
func(tx neo4j.ManagedTransaction) (neo4j.Node, error) { // (3)
// Use tx.Run to read from the database
}
)
-
❏ session.read
-
❏ graphDataBase.readQuery
-
✓ neo4j.ExecuteRead
-
❏ neo4j.ExecuteWrite
Once you have selected your answer, click Check Answer to continue.
Hint
You are looking to execute a read query against the database.
Solution
The answer is neo4j.ExecuteRead
Lesson Summary
In this challenge you successfully recognised the correct method for executing a Cypher statement in a read transaction.
So far, we have used the neo4j.CollectTWithContext()
method to access results. In the next lesson, we will look at the alternative methods available for accessing records.