MCPcopy Create free account
hub / github.com/RedisGraph/redisgraph-go / ExampleGraphNew

Function ExampleGraphNew

example_graph_test.go:14–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12)
13
14func ExampleGraphNew() {
15 conn, _ := redis.Dial("tcp", "0.0.0.0:6379")
16
17 graph := redisgraph.GraphNew("social", conn)
18
19 q := "CREATE (w:WorkPlace {name:'RedisLabs'}) RETURN w"
20 res, _ := graph.Query(q)
21
22 res.Next()
23 r := res.Record()
24 w := r.GetByIndex(0).(*redisgraph.Node)
25 fmt.Println(w.Label)
26 // Output: WorkPlace
27}
28
29func ExampleGraphNew_pool() {
30 host := "localhost:6379"

Callers

nothing calls this directly

Calls 4

QueryMethod · 0.80
NextMethod · 0.80
RecordMethod · 0.80
GetByIndexMethod · 0.80

Tested by

no test coverage detected