0

I have the following Cypher query which I can run in a browser console to produce the desired result:

MATCH (start:`Neo4j::Record` {record_id: 1547}), (end:`Neo4j::Record` {record_id: 1850})
MATCH p=shortestPath((start)-[:`NEO4J::RECORD_ASSOCIATION`*]->(end))
RETURN p

In this case, there's a direct link between the records:

{
  "start": {
"identity": 62,
    /// lots of stuff cut here.
  ],
  "length": 1.0
}

...so the "length": 1.0 is what I need.

I'd expect to be able to run this directly in the following manner:

result = ActiveGraph::Base.query(length_query) 

But this returns an object of class Neo4j::Driver::Internal::InternalResult which is rather verbose and appears to not contain the data I need. There's reference to "p" being available in the form of @keys=[:p], but no sign that I can see otherwise.

Any hints on how to proceed would be welcome.

EDIT: There's definitely no sign of the "length" value when I run this. In the browser it only appears if I choose to view results as a table.

cybersam
  • 63,203
  • 6
  • 53
  • 76
knirirr
  • 1,860
  • 4
  • 23
  • 37

1 Answers1

0

This is also dealt with by the answer to my other question, if I re-structure the data: Constructing Activenode models for quicker querying

knirirr
  • 1,860
  • 4
  • 23
  • 37