Skip to content

Commit 31b0cb8

Browse files
maguecswilly22
authored andcommitted
(feature) add flush function to commit graph, but zero out all additions (#23)
1 parent a2b24e3 commit 31b0cb8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

redisgraph/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@ def commit(self):
135135

136136
return self.query(query)
137137

138+
def flush(self):
139+
"""
140+
Commit the graph and reset the edges and nodes to zero length
141+
"""
142+
try:
143+
self.commit()
144+
self.nodes = {}
145+
self.edges = []
146+
except:
147+
print("Error flushing graph")
148+
138149
def query(self, q):
139150
"""
140151
Executes a query against the graph.

0 commit comments

Comments
 (0)