Hi, I'm trying to create graph using createGraph(name='', createCollections=), but value error raised.
The collection and relation were created like below:
from pyArango.connection import *
from pyArango.collection import *
def create_collection(table):
conn = Connection(username="root", password="root")
db = conn["_system"]
if db.hasCollection(table):
db[table].delete()
db.reload()
collec = db.createCollection(className='Collection', name=table)
doc1 = collec.createDocument({"_key":table})
doc1.save()
def create_relation(table, rel_name, relation):
conn = Connection(username="root", password="root")
db = conn["_system"]
if db.hasCollection(rel_name):
rel = db[rel_name]
else:
rel = db.createCollection(className='Edges', name=rel_name)
I didn't use follows:
class collection(Collection):
_fields = {
"name": Field()
}
class relation(Edges):
_fields = {
"number": Field()
}
Because the names of collections and relations are function parameter, the class could not be used as the example above. However I failed to create graph without using the class. Also, I want to use function parameter when I make a graph. Are there solutions for these?
Hi, I'm trying to create graph using createGraph(name='', createCollections=), but value error raised.
The collection and relation were created like below:
I didn't use follows:
Because the names of collections and relations are function parameter, the class could not be used as the example above. However I failed to create graph without using the class. Also, I want to use function parameter when I make a graph. Are there solutions for these?