Documentation ¶
Overview ¶
Package mem is a simple memory based implementation of DatabaseService.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDb ¶
NewDb creates a DB instance of a simple memory backed graph DB
Example ¶
db, _ := NewDb("test", nil) nodeA := db.NewNode() nodeA.SetProperty("foo", "bar") nodeB := db.NewNode() fmt.Println("nodes: ", nodeA, nodeB) relAB := nodeA.RelateTo(nodeB, "BELONGS_TO") fmt.Println("relation: ", relAB) path := db.FindPath(nodeA, nodeB) fmt.Println("path: ", path) nodeC := db.NewNode("A") nodeB.RelateTo(nodeC, "BELONGS_TO") path = db.FindPath(nodeA, nodeC) fmt.Println("path: ", path)
Output: nodes: (0 {foo:"bar",}) (1) relation: (0 {foo:"bar",})-[:BELONGS_TO]->(1) path: (0 {foo:"bar",})-[:BELONGS_TO]->(1) path: (0 {foo:"bar",})-[:BELONGS_TO]->(1)-[:BELONGS_TO]->(2:A)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.