ArangoDB-Community / pyArango

Python Driver for ArangoDB with built-in validation
https://pyarango.readthedocs.io/en/latest/
Apache License 2.0
238 stars 90 forks source link

Edge collection is not created #168

Open TrebuhD opened 4 years ago

TrebuhD commented 4 years ago

I'm trying to create an edge collection like this:

db.createCollection(name=name, className='Edges', type=3)

but it creates a document collection instead. The documentation is a bit lacking on this one.

How do I create an edge collection?

Boxx1483 commented 4 years ago

Hey mate. You can create edges like this: Edge_doc = db.createCollection("Edges",name="name_of_edge_collection")

And here's an example of insert an edge doc `entry = Edge_doc.createEdge()

entry["attribute"] = "attribute on edge" entry.links("arangodoc1/dockey", "arangodoc2/dockey") `

The Final statement is creating the "_from" and "_to" statements in the edge