我几乎复制了example并调整了数据库查询。我不明白为什么司机不被识别?
版本: Node: v11.13.0 ne4j-driver:"^1.7.5“
我得到了错误:
var driver = neo4j.v1.driver(
^
TypeError: Cannot read property 'driver' of undefined我的代码:
var neo4j = require('neo4j-driver').v1;
var driver = neo4j.v1.driver(
'bolt://localhost:7687',
neo4j.auth.basic('neo4j', 'Neo4j')
)
var session = driver.session()
session
.run('MATCH (n:Person) return n', {
//nameParam: 'Alice'
})
.subscribe({
onNext: function(record) {
console.log(record.get('n'))
},
onCompleted: function() {
session.close()
},
onError: function(error) {
console.log(error)
}
})发布于 2019-06-26 04:20:30
你可能是故意这样做的:
var neo4j = require('neo4j-driver').v1;
var driver = neo4j.driver(
...或者,如果出于某种原因,您希望每次使用时都能够显式指定库版本,请执行以下操作:
var neo4j = require('neo4j-driver');
var driver = neo4j.v1.driver(
...发布于 2019-12-24 13:22:01
他们的文档好像搞砸了,我也有同样的问题。卸下v1即可正常工作。不确定这是否是默认的不同版本的驱动程序或其他什么...
let config = require("./config")[env]
const uri = 'bolt://localhost:7687'
const neo4j = require('neo4j-driver');
const driver = neo4j.driver(uri, neo4j.auth.basic(config.username, config.password));FWIW定义配置文件的方式也被破坏了。node自注册在很大程度上是一个障碍。
https://stackoverflow.com/questions/56755823
复制相似问题