You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_transaction():
client=ArangoClient()
sys_db=client.db(
"_system", username="username", password="password"
)
# drop and recreate the test dbsys_db.delete_database("test", ignore_missing=True)
sys_db.create_database("test")
db=client.db(
"test", username="username", password="password"
)
# create stuffgraph=db.create_graph("graph")
graph.create_vertex_collection("a")
graph.create_vertex_collection("b")
edge=graph.create_edge_definition(
edge_collection="edge",
from_vertex_collections=["a"],
to_vertex_collections=["b"],
)
tx=db.begin_transaction(
read=["a", "b", "edge"],
write=["a", "b", "edge"],
)
graph=tx.graph("graph")
# does not work with regular collection eithera=graph.vertex_collection("a")
b=graph.vertex_collection("b")
a_doc=a.insert({})
b_doc=b.insert({})
# verify that they are retrievable without committingasserta.get(a_doc["_key"]) isnotNoneassertb.get(b_doc["_key"]) isnotNoneedge=graph.edge_collection("edge")
# link a and bedge.link(a_doc["_id"], b_doc["_id"])
edges=edge.edges(a_doc["_id"])
# this fails without committing# tx.commit_transaction()assertlen(edges["edges"]) ==1tx.abort_transaction()
The text was updated successfully, but these errors were encountered:
Seems that EdgeCollection.edges() (GET /_api/edges/<name>) does not behave the same way as EdgeCollection.get() (GET /_api/gharial/<graph name>/edge/<id>) in terms of transactions.
Transaction works with documents, but not edges.
Platform info:
Sample code to reproduce:
The text was updated successfully, but these errors were encountered: