Skip to content

Commit c8668e4

Browse files
authored
Merge branch 'main' into add-algo-section
2 parents 8a6b005 + b1960ff commit c8668e4

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

getting_started.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ You can execute these commands using the FalkorDB Python client.
8181
from falkordb import FalkorDB
8282

8383
# Connect to FalkorDB
84-
client = FalkorDB(host="localhost", port=6379, password="your-password")
85-
graph = client.select_graph('social')
84+
db = FalkorDB(host="localhost", port=6379, password="your-password")
85+
graph = db.select_graph('social')
8686
```
8787

8888
### Execute Cypher Queries
@@ -115,32 +115,31 @@ print("Graph created successfully!")
115115
```python
116116
# Find all friends of Alice
117117
query = """
118-
119-
date and time as they are right now can be confusing, either use Python to create timestamps from actual dates or consider changing the attribute to something else which doesn't require time / date datatype
120-
121-
MATCH (alice:User {name: "Alice"})-[:FRIENDS_WITH]->(friend)
118+
MATCH (alice:User {name: 'Alice'})-[:FRIENDS_WITH]->(friend)
122119
RETURN friend.name AS Friend
123120
"""
124-
result = graph.ro_query(query)
121+
122+
result = graph.ro_query(query).result_set
125123

126124
print("Alice's friends:")
127125
for record in result:
128-
print(record["Friend"])
126+
print(record[0])
129127
```
130128

131129
#### Query Relationships
132130

133131
```python
134132
# Find posts created by Bob
135133
query = """
136-
MATCH (bob:User {name: "Bob"})-[:CREATED]->(post:Post)
134+
MATCH (bob:User {name: 'Bob'})-[:CREATED]->(post:Post)
137135
RETURN post.content AS PostContent
138136
"""
139-
result = graph.ro_query(query)
137+
138+
result = graph.ro_query(query).result_set
140139

141140
print("Posts created by Bob:")
142141
for record in result:
143-
print(record["PostContent"])
142+
print(record[0])
144143
```
145144

146145
---

0 commit comments

Comments
 (0)