orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 68 forks source link

In/Out reversed in Graph Traverse #424

Closed hethcox closed 4 years ago

hethcox commented 4 years ago

I'm traversing a graph and it appears that the in and out are reversed on edges.

        let query = 'TRAVERSE * FROM ' + rootRID;
        await res.locals.db.command(query).all()
            .then(function (rows) {
                dumpGraph(rows, rows[0]);
                result = rows.slice();
            });
        res.send(result);

In my DB I have an edge from (vertices) 37:0 to 38:0. But in the query result these are reversed.

{
        "@class": "HasSubheading",
        "in": "#38:0",
        "out": "#37:0",
        "@rid": "#41:0",
        "@version": 1
    }

Am I using this incorrectly or is it a bug?

hethcox commented 4 years ago

Please disregard. I'm not sure what's what. These two screenshots from Orient Studio seem to contradict each other. I guess 'out' means the vertex that this edge comes from.

Screen Shot 2020-01-15 at 4 29 14 PM Screen Shot 2020-01-15 at 4 25 56 PM
wolf4ood commented 4 years ago

Hi @hethcox

for historical reason they are called in/out which are

in = to
out = from

which basically reflect the traversal step from Edges eg.

select Id,outE("HasFriend").inV() from Profiles

Let me know if this helps

Thanks

hethcox commented 4 years ago

Thanks for the response. As longs as it's consistent I can work with it.