如何通过Javascript访问Neo4j数据集? [英] How to access Neo4j dataset through Javascript?

查看:606
本文介绍了如何通过Javascript访问Neo4j数据集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过Javascript访问Neo4j上的(示例)数据集,即我具有电影数据集,因此我想通过本地html页面获取和接收查询吗?您可能想知道,我是一个初学者,如果有人能一步一步向我解释它,我将非常感谢:)

I am wondering how I get access to my (example)dataset that I have on Neo4j through Javascript, i.e. I have a movie dataset, so I would like to get and receive queries through an local html page? As you might wonder, I am a very beginner to this and I really appreciate it if someone would explain it to me step by step :)

预先感谢

推荐答案

您可以通过http事务端点访问Neo4j图形数据库

You can access your Neo4j graph database through the http transactional endpoint

< a href = http://neo4j.com/docs/stable/rest-api-transactional.html rel = nofollow> http://neo4j.com/docs/stable/rest-api-transactional.html

并发出密码查询来查询您的图形。

and issue cypher queries to query your graph.

由于它是http端点,因此您可以通过普通的ajax请求访问它,例如带有jQuery

As it is a http endpoint, you can access it with normal ajax requests, an e.g. with jquery

var body = JSON.stringify({
                statements: [{
                    statement: 'MATCH (n) RETURN count(n)'
                }]
            });
$.ajax({
            url: "http://localhost:7474",
            type: "POST",
            data: body,
            contentType: "application/json"
        })
            .done(function(result){
                console.log(result);

            })
            .fail(function(error){
                console.log(error.statusText);
            });

这篇关于如何通过Javascript访问Neo4j数据集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆