cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Getting `DbHits` through nest children

I have a snippet of code where I run a query so I can extract the DbHits for the query. My aim is to use this as a reference as I tune the queries. I am having an issue where I cannot seem to extract the "nested" DbHit values. Is there a key to accessing this?

Here is a sample of the code I am running:

 public void Option1()
        {
            using (var session = _driver.Session())
            {
                var query = session.ReadTransaction(tx =>
                {
                    var result = tx.Run("PROFILE MATCH (p:Process)-[:FIRST_STEP]->(ps_start:ProcessStep) " +
                                        "MATCH path = (ps_start)-[:NEXT_STEP*]->() " +
                                        "WITH nodes(path) AS steps " +
                                        "UNWIND steps AS step " +
                                        "RETURN step");
                    return result.Summary.Profile.DbHits;
                    //return result.Summary.Profile;
                });
                Console.WriteLine("Option 1: # of db hits = ");
                //Console.WriteLine("Query Profile: ");
                Console.WriteLine(query);
            }
        }
1 REPLY 1

mdfrenchman
Graph Voyager

Try moving Console.WriteLine in place of the return. The return is probably what's screwing you up.

Console.WriteLine($"Option 1: # dbHits = {result.Summary.Profile.DbHits}");

Welcome to the land of C#