我使用neo4j驱动程序查询neo4j。这通常可以正常工作,但是命令:
match (city:city)-[r:lies_in]->(country:country) return city,country
仅返回城市。 完全相同的命令在Neo4j- Browser中可以正常工作,并返回城市和国家/地区。
这是neo4j query.log中的行:
2019-04-25 07:19:21.870+0000 INFO 4 ms: bolt-session bolt neo4j-javascript/1.7.3 client/127.0.0.1:49824 server/127.0.0.1:7687> - match (city:city)-[r:lies_in]->(country:country) return city,country - {} - {}
这是相关的代码:
const neo4j = require('neo4j-driver').v1;
const driver = neo4j.driver('bolt://127.0.0.1:7687', neo4j.auth.basic('', ''));
const session = driver.session();
console.log (command);
session.run(
`${command}`
)
.then(result => {
session.close();
console.log (result);