Created
March 28, 2017 17:22
-
-
Save n5i/7c471d02dfd1086ebb132707b3fb3e26 to your computer and use it in GitHub Desktop.
Receiving nested response from Neo4j to Golang.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import( | |
"github.com/jmcvetta/neoism" | |
"fmt" | |
) | |
func main(){ | |
// Connect to the neo4j database with the address provided | |
db, _ := neoism.Connect("http://neo4j:xxx@localhost:7474/db/data") | |
type Report struct { | |
Name string | |
Subreports []Report | |
} | |
res := make([]Report, 0) | |
cq := neoism.CypherQuery{ | |
Statement: `CALL test.nested()`, | |
Result: &res, | |
} | |
err = db.Cypher(&cq) | |
if err != nil { | |
fmt.Printf("There was an error on request %v\n", err) | |
} | |
fmt.Printf("Result: %#v\n", res) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment