Skip to content

Commit d39d70a

Browse files
committed
Update Readme, added link to cypher gem
1 parent 63da260 commit d39d70a

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,29 @@ node2 = @neo.create_node("age" => 33, "name" => "Roel")
138138
@neo.add_node_to_index("people", "name", "max", node1)
139139
@neo.get_node_index("people", "name", "max")
140140

141-
# Cypher queries:
142-
@neo.execute_query("start n=node(0) return n")
143-
144141
# Batches:
145142
@neo.batch [:create_node, {"name" => "Max"}],
146143
[:create_node, {"name" => "Marc"}]
144+
145+
# Cypher queries:
146+
@neo.execute_query("start n=node(0) return n")
147+
148+
```
149+
150+
You can also use the [cypher gem](https://github.com/andreasronge/neo4j-cypher) instead of writing cypher as text.
151+
152+
153+
```
154+
node(1).outgoing(rel(:friends).where{|r| r[:since] == 1994})
155+
```
156+
157+
would become:
158+
159+
```
160+
START me=node(1)
161+
MATCH (me)-[friend_rel:`friends`]->(friends)
162+
WHERE (friend_rel.since = 1994)
163+
RETURN friends
147164
```
148165

149166
This is just a small sample of the full API, see the [Wiki documentation](https://github.com/maxdemarzi/neography/wiki) for the full API.

0 commit comments

Comments
 (0)