Pyorient : Create an edge in OrientDB without using raw query

220 views Asked by At

I tried

graph.create_edge(Friend, orientRecord1, orientRecord2)

But I get AttributeError: 'OrientRecord' object has no attribute '_id'

because orientRecord does not have an _id in it. What am I doing wrong? How can I use this function?

Here are my class structures

class Person(Node):
    id = String(unique = True)
    name = String()
    pass


class Friend(Relationship):
    pass
1

There are 1 answers

1
lsavio On

You can create an edge with the "command" statement:

enter image description here

and the result is this:

enter image description here

That is correct output, since the graph is this :

enter image description here