Tag: neo4j cypher

如何通过neo4j REST API正确地创build数千个cypher节点?

我需要在cypher <3.0.0中通过node.js创build很多节点(比如50.000)。 我正在使用async.times发布所有密码查询。 不过看起来REST API正在崩溃(并死亡),因为可能有太多的请求通过。 我想继续使用节点,而不是使用LOAD CSV。 我的代码如下: var createStyles = function (data, cb) { var distinctData = …; console.log("creating styles"); … var create = function (id, callback) { console.log("creating st " + id); var req = … styles.addOrUpdate(req, null, function (err, node) { callback(null, node); }); } // call the same function multiple times […]

在node.js的Cypher REST API中为Neo4j提供'query'参数的正确方法

如何在node.js中通过POST请求构造正确的Cypher查询到Neo4j? 码: var http = require('http'); var options = { host: 'a90cfa68c.hosted.neo4j.org', port: 7357, path: '/db/data/cypher', method: 'POST', headers: { 'Authorization': 'Basic ' + new Buffer("<login>:<password>").toString('base64') }, "Content-Type" : "application/json", "query" : "START root=node(*) RETURN root" // <— Doesn't work 🙁 }; http.request(options, function(res) { console.log('STATUS: ' + res.statusCode); console.log('HEADERS: ' + JSON.stringify(res.headers)); res.setEncoding('utf8'); res.on('data', […]

如何使用Neo4j驱动程序按需中止查询

我使用Node.js和Neo4j制作search引擎应用程序,允许用户通过基于Web的用户界面提交graphics遍历查询。 我想让用户select在提交后取消查询(即如果用户决定更改查询参数)。 因此,我需要一种方法来使用Node.js-to-Neo4j驱动程序的命令或通过Cypher查询中止查询。 经过几个小时的search之后,我一直无法find使用任何Node.js-to-Neo4j驱动程序来执行此操作的方法。 我也似乎无法find允许查询查杀的密码查询。 我忽略了一些东西,或者Neo4j不可能? 我目前正在使用Neo4j 2.0.4,但是我愿意升级到新版本的Neo4j,如果它具有查询查杀能力。

为什么Node-Neo4j没有正确设置数据?

想象一下这样的查询: match (i:QuestionOrder) set i.count=i.count+1 merge (q:Question {text: '+text here+', index: i.count}) return q Neo4j保证写入locking,如果集合发生在node-neo4j中同一个查询所隐含的相同事务中。 但是,我得到以下输出: [ { "columns":["q"], "data":[{"text":"Have Kids…","index":1,"_id":542}] }, { "columns":["q"], "data":[{"text":"You are…","index":1,"_id":545}] } ] 从我的理解来看,锁应该防止index相同。 我在这里错过了什么? 我该如何解决这个问题?