diff --git a/index.md b/index.md index 4af90974..5f3f3b04 100644 --- a/index.md +++ b/index.md @@ -74,7 +74,11 @@ 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() +try: + g.delete() +except redis.exceptions.ResponseError: + # Graph doesn't exist yet, which is fine + pass g.query("""CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}), (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}),