Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Neo4j dataset through Javascript?

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 :)

Thanks in advance

like image 206
Y_Lakdime Avatar asked Mar 16 '26 02:03

Y_Lakdime


1 Answers

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

http://neo4j.com/docs/stable/rest-api-transactional.html

and issue cypher queries to query your graph.

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);
            });
like image 144
Christophe Willemsen Avatar answered Mar 18 '26 16:03

Christophe Willemsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!