Closed pangguoming closed 8 years ago
What version of node-neo4j are you running? And can you paste your code?
i user version "neo4j": "2.0.0-RC2"
the following is my code: may be it is because of :shortestPath function
var neo4j = require('neo4j');
var db = new neo4j.GraphDatabase('http://neo4j:pgmopen@localhost:7474');
var cypher_params = {
start: 'Universidades' ,
end: 'Portal de la 80'
};
var query = [
'MATCH path=shortestPath(',
'(st1:STATION {name:{start}})-[*]-(st2:STATION {name:{end}})',
')',
'RETURN path'
].join('\n');
db.cypher({
query: query,
params: cypher_params
}, function (err, results) {
if (err) throw err;
var result = results[0];
if (!result) {
console.log('No user found.');
} else {
console.log(JSON.stringify(result));
}
});
Okay, thanks.
Yes, returning paths directly isn't recommended with db.cypher
, because Neo4j's REST API indeed only returns URLs. Instead, consider returning NODES(path)
or similar.
Full reference of functions: http://neo4j.com/docs/stable/query-functions-collection.html
Does that help?
RETURN NODES(path),relationships(path)
i think that is the only way, thanks a lot sir.
i get results like:
Why are all value URL ?