Skip to content

Commit

Permalink
Update RedisGraph README.md (#2239)
Browse files Browse the repository at this point in the history
* Update README.md

Simple example using Cypher to CREATE a graph with relationships and then MATCH on that graph

* Update README.md

Co-authored-by: Leibale Eidelman <[email protected]>
  • Loading branch information
jkoontz2010 and leibale authored Oct 25, 2022
1 parent 64e982d commit 4cfad3d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions packages/graph/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# @redis/graph

Example usage:
```javascript
import { createClient } from 'redis';

const client = createClient();
client.on('error', (err) => console.log('Redis Client Error', err));

await client.connect();

await client.graph.query(
'graph',
"CREATE (:Rider { name: 'Buzz Aldrin' })-[:rides]->(:Team { name: 'Apollo' })"
);

const result = await client.graph.query(
'graph',
`MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = 'Apollo' RETURN r.name, t.name`
);

console.log(result);
```

Output from console log:
```json
{
headers: [ 'r.name', 't.name' ],
data: [ [ 'Buzz Aldrin', 'Apollo' ] ],
metadata: [
'Cached execution: 0',
'Query internal execution time: 0.431700 milliseconds'
]
}
```

0 comments on commit 4cfad3d

Please sign in to comment.