cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Instead of Getting data from file. How to get it from Neo4j server

rosdiana
Node Clone

Hi,

I would like to get data from Neo4J server directly when i click on each node. how can i do that.

Below is the code in js.

 neo4jDataUrl: 'json/data-movie.json',
                    
                    //neo4jData: datagraph,
                                    
                    nodeRadius: 10,
                   
                    onRelationshipDoubleClick: function(relationship) {
                        console.log('double click on relationship: ' + JSON.stringify(relationship));
                    },
                    onNodeDoubleClick: function (node) {
                            console.log(node.id)

                            secondQuery = {
                                "statements": [
                                    {
                                        "statement": "MATCH(n)<-[r]->(c) where ID(n)= " + node.id + " return n,c,r LIMIT 1",
                                        "resultDataContents": ["graph"]
                                    }
                                ]
                            }

                            $.ajax({
                                url: 'http://localhost:7474/db/data/transaction/commit',
                                headers: {
                                    'Authorization': 'Basic <token>',
                                    'Content-Type': 'application/json'
                                },
                                method: 'POST',
                                dataType: 'json',
                                data: JSON.stringify(secondQuery),
                                success: function (data) {

                                    neo4jd3.updateWithNeo4jData(data);
                                }
                            });

                        },
                    zoomFit: true

My issue is what is 'Authorization': 'Basic '? How can i get it this parameters value? Thank you.

headers: {

  •                                'Authorization': 'Basic <token>',*
    
  •                                'Content-Type': 'application/json'*
    
  •                            },*
0 REPLIES 0