This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from py2neo import Graph, Node, Relationship | |
| g = Graph(password="admin") | |
| tx = g.begin() | |
| john = Node("User", name="John", gender="M", age="28") | |
| tx.create(john) | |
| mary = Node("User", name="Mary", gender="F", age="26") | |
| tx.create(mary) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "results": [{ | |
| ... | |
| "data": [ | |
| {"row": [ | |
| { "gender": "M", | |
| "name": "John", | |
| "age": "28" }, | |
| {}, | |
| { "name": "The Beatles", | |
| "category": "Musician/Band" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MATCH (:User {name: "John"}) -[:LIKES]-> (pages) | |
| RETURN pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "results": [ | |
| {... | |
| "graph": { | |
| "nodes": [ | |
| { "id": "1", | |
| "labels": [ "User" ], | |
| "properties": { | |
| "gender": "M", | |
| "name": "John", | |
| "age": "28" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MATCH (john:User), (mary:User) | |
| WHERE john.name="John" AND mary.name="Mary" | |
| CREATE (john)-[f:FRIENDS_WITH]->(mary) | |
| RETURN john, f, mary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "results": [ | |
| {... | |
| "graph": { | |
| "nodes": [ | |
| { | |
| "id": "1", | |
| "labels": [ | |
| "User" | |
| ], | |
| "properties": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE (john:User {name:'John', gender:'M', age:'28'}) | |
| RETURN john |
NewerOlder