https://github.com/windler/go-neo4j-cypher
go neo4j transactional cypher HTTP api client
https://github.com/windler/go-neo4j-cypher
Last synced: over 1 year ago
JSON representation
go neo4j transactional cypher HTTP api client
- Host: GitHub
- URL: https://github.com/windler/go-neo4j-cypher
- Owner: windler
- License: mit
- Created: 2018-09-12T17:26:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-16T11:27:57.000Z (over 7 years ago)
- Last Synced: 2025-01-20T16:53:40.221Z (over 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://goreportcard.com/report/github.com/windler/go-neo4j-cypher) [](https://codebeat.co/projects/github-com-windler-go-neo4j-cypher-master)
# go neo4j cypher http api client
`Golang` HTTP api client to access [neo4j](https://neo4j.com/) [transactional cypher endpoint](https://neo4j.com/docs/developer-manual/3.4/http-api/#http-api-transactional).
## Tested neo4j versions
|Version|Success?|
|-|-|
|3.4|yes|
## Installation
```bash
go get github.com/windler/go-neo4j-cypher
```
## Usage
```go
import neo4j "github.com/windler/go-neo4j-cypher"
func query() {
client := neo4j.NewHTTPCypherClient("http://", "neofj-host", 7474, "myuser", "secret")
result, err := client.Execute(&neo4j.CypherStatement{
Statement: `MATCH (s)
WHERE s.name = {name}
return s.name as nodeName`,
Parameters: map[string]interface{}{
"name": "Alfred",
},
})
if err != nil {
panic(err.Error())
}
if len(result.Errors) > 0 {
//handle Errors
}
// optional: map result to string slice
strResult := result.Map("nodeName", func(rowValue interface{}, meta neo4j.CypherQueryResultValueMeta) interface{} {
return rowValue.(string)
})
//... handle strResult ...
}
```