Neo4j SET(更新)节点属性错误

时间:2017-04-04 18:07:14

标签: javascript neo4j

我正在尝试使用JavaScript设置(更新)Neo4j。我正在使用JavaScript语言驱动程序。

我的代码已执行,但节点属性未更新。

这是我的代码:

        return session.run("MATCH (a:Person) WHERE a.ID = {id} SET a.name = {name}, a.email = {email}", {
            id: 114,
            name: name,
            email: email
        });

1 个答案:

答案 0 :(得分:0)

Javascript数字是32位,Neo4j是64位,在设置或检索数字数据时需要进行一些转换。

这是驱动程序自述文件中的relevant section。传递的数字被转换为float,因此您需要通过neo4j.int()传递数字以强制它为int类型:

return session.run("MATCH (a:Person) WHERE a.ID = {id} SET a.name = {name}, a.email = {email}", {
            id: neo4j.int(114),
            name: name,
            email: email
        });
相关问题