Skip to content

Commit

Permalink
Merge pull request #49 from TransAMrit/patch-1
Browse files Browse the repository at this point in the history
Fix incorrect example
  • Loading branch information
swilly22 authored Aug 13, 2024
2 parents 9bdd369 + 2432b06 commit ff1e2ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ db = FalkorDB(host='localhost', port=6379)

# Create the 'MotoGP' graph
g = db.select_graph('MotoGP')
# Clear out this graph in case you've run this script before.
g.delete()
g.query("""CREATE
(:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}),
(:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}),
Expand All @@ -61,7 +63,7 @@ for row in res.result_set:
# Query how many riders represent team Ducati ?
res = g.query("""MATCH (r:Rider)-[:rides]->(t:Team {name:'Ducati'}) RETURN count(r)""")

print(row[0]) # Prints: 1
print(res.result_set[0][0]) # Prints: 1
```

For additional demos please see visit [Demos](https://github.com/FalkorDB/demos).
Expand Down

0 comments on commit ff1e2ab

Please sign in to comment.