Skip to content

Commit c3e9e21

Browse files
authored
docs(interactive): enable cypher before querying (#4339)
1 parent 044c9ef commit c3e9e21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/overview/getting_started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ In this example, we use graph traversal to count the number of papers two given
8080
8181
```python
8282
# get the endpoint for submitting interactive queries on graph g.
83-
interactive = graphscope.interactive(g)
83+
interactive = graphscope.interactive(g, with_cypher=True)
8484
8585
# Gremlin query for counting the number of papers two authors (with id 2 and 4307) have co-authored
8686
papers = interactive.execute("g.V().has('author', 'id', 2).out('writes').where(__.in('writes').has('id', 4307)).count()").one()
@@ -261,7 +261,7 @@ gs.set_option(show_log=True)
261261
graph = load_modern_graph()
262262
263263
# Hereafter, you can use the `graph` object to create an `interactive` query session, which will start one Gremlin service and one Cypher service simultaneously on the backend.
264-
g = gs.interactive(graph)
264+
g = gs.interactive(graph, with_cypher=True)
265265
# then `execute` any supported gremlin query.
266266
q1 = g.execute('g.V().count()')
267267
print(q1.all().result()) # should print [6]
@@ -270,7 +270,7 @@ q2 = g.execute('g.V().hasLabel(\'person\')')
270270
print(q2.all().result()) # should print [[v[2], v[3], v[0], v[1]]]
271271
272272
# or `execute` any supported Cypher query
273-
q3 = g.execute("MATCH (n:person) RETURN count(n)", lang="cypher", routing_=RoutingControl.READ)
273+
q3 = g.execute("MATCH (n:person) RETURN count(n)", lang="cypher")
274274
print(q3.records[0][0]) # should print 6
275275
```
276276
````

0 commit comments

Comments
 (0)