https://github.com/thedanielforum/arangodb
https://github.com/thedanielforum/arangodb
arangodb database-driver golang
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thedanielforum/arangodb
- Owner: thedanielforum
- Created: 2017-03-16T06:01:20.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-09T10:04:17.000Z (almost 9 years ago)
- Last Synced: 2025-04-04T12:34:06.623Z (10 months ago)
- Topics: arangodb, database-driver, golang
- Language: Go
- Size: 17.6 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# arangodb driver
How to install
```bash
go get github.com/thedanielforum/arangodb
```
Set up a connection to arango
```go
package main
import "github.com/thedanielforum/arangodb"
var conn *arangodb.Connection
func main() {
var err error
conn, err = arangodb.NewConnection(
"127.0.0.1:8529",
"root",
"awstest123",
&arangodb.Config{
DebugMode: false,
},
)
conn.SetDB("test")
if err != nil {
panic(err)
}
}
```
Get one document
```go
var vid *Videos
err = connection.NewQuery(`FOR x IN %s RETURN x`, "videos").One(&vid)
if err != nil {
panic(err)
}
```
Get all documents from query
```go
var vids []Video
err = connection.NewQuery(`FOR x IN %s RETURN x`, "videos").All(&vids)
if err != nil {
panic(err)
}
```