Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-01-2019 02:43 PM
I have used the official .NET driver to create a small graph representing my domain. It all works fine. I am also able to retrieve individual nodes and convert them to typed objects. So far so good.
But then I want to do some more complex questions like:
Most of the API makes sense but I find the handling of the result object strange and cumbersome. I can handle simple results but when it gets complex it goes beyond my understanding.
This query makes perfect sense and works in the direct browser window, but I just can't figure out how to get meaningful resulst through the driver:
MATCH (n {id:54})-[r]->(m)
RETURN r,m
What is best practice in .NET to achieve the intended result with my two queries?
01-02-2019 01:31 AM
I probably messed things up earlier for today I actually succeeded to do what I intended
using(var session = Driver.Session())
{
var statement = $"MATCH (n:{label} {{id:{id}}})-[r]-(m) RETURN r,m";
var result = session.Run(statement);
foreach(var record in result)
{
var node = record["m"].As<INode>();
var relation = record["r"].As<IRelationship>();
// TODO: Process result
}
}
I found out the retrieved result is tricky to trust in debug since it actually vanished quite fast!
It is probably related to the buffering.
The takeaway is that you have to be fast to investigate the result or you will have some surprisingly empty result.
All the sessions of the conference are now available online