简体   繁体   English

在js中使用neo4j驱动程序

[英]Using neo4j driver in js

I am pretty new to js and making web applications, but i have helped to build a web app that uses ne04j. 我对js和制作Web应用程序很陌生,但是我已经帮助构建了一个使用ne04j的Web应用程序。 I am trying to use the neo4j driver now with BOLT to access the community edition. 我正在尝试将neo4j驱动程序与BOLT一起使用以访问社区版本。

I am trying to use url = 'bolt://localhost:7474' 我正在尝试使用url ='bolt:// localhost:7474'

But i cannot get it to work. 但是我无法使它工作。

I was wondering if this is because I need to somehow link the neo4j driver to the js script and if anyone could let me know how to do this. 我想知道这是否是因为我需要以某种方式将neo4j驱动程序链接到js脚本,以及是否有人可以让我知道如何执行此操作。

var url_ = 'bolt://localhost:7687' 
var pword = 'neo4j2' 
sigma.neo4j.getLabels(
            { url: url_, user: 'neo4j', password: pword },
            function (labels) {
                console.log(labels)
                NodeLabels = labels;
                console.log("NodeLabels: " + NodeLabels);
            }
    ); 

Thank you! 谢谢!

James 詹姆士

FYI, 7474 is the http port, not the bolt one. 仅供参考, 7474http端口,不是螺栓端口。 So you need to replace bolt://localhost:7474 by bolt://localhost:7687 or by http://localhost:7474 . 因此,您需要用bolt://localhost:7687http://localhost:7474替换bolt://localhost:7474 http://localhost:7474

The Sigma plugin for Neo4j only use the HTTP endpoint of Neo4j : Neo4j的Sigma插件仅使用Neo4j的HTTP端点:

var url_ = 'http://localhost:7474' 
var pword = 'neo4j2' 
sigma.neo4j.getLabels(
  { url: url_, user: 'neo4j', password: pword },
  function (labels) {
    console.log(labels)
    NodeLabels = labels;
    console.log("NodeLabels: " + NodeLabels);
  }
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM