Edge @rid on IN property of Vertex appears as document in stead of #xx:x on OrientJS transaction

38 ikustaldi
Joan irakurri gabeko lehen mezura

Krishnaraj H

irakurri gabe,
2017(e)ko api. 13(a) (02:23:23)17/4/13
Hartzailea: orient-...@googlegroups.com
Hi,
We are using OrientJS transaction mechanism in our coding to create vertex and edge. Currently facing an issue while creating edges. Sometimes, when we create edge e1 of sampleEdge from V1 to V2 edge rid (in_sampleEdge on V2) is loaded as document:{@type:document,@version:0,out:#12:3,in:#45:6}
If we query on sampleEdge then e1 appears to be #78:9
If we query on V1 then e1 appears to be out_sampleEdge = #78:9
If we query on e1 of sampleEdge (i.e. #78:9) output is {@type:document,@version:1,out:#12:3,in:#45:6}. Please note the versions. Actual version is 1 but on V2's IN property it appears as document with version 0.

Please find the Query results. Here I am creating User verted, Project Vertex and creating edge ownedByUser.
1. select * from #278:56 (Query on Edge)
{"@type":"d","@rid":"#278:56","@version":1,"@class":"ownedByUser","out":"#96:54","in":"#45:34","@fieldTypes":"out=x,in=x"}

2. select out_ownedByUser from #96:54 (Query on Project)
{"@type":"d","@rid":"#-2:0","@version":0,"out_ownedByUser":["#278:56"],"@fieldTypes":"out_ownedByUser=g"}

3. select in_ownedByUser from #45:34 (Query of User)
{"@type":"d","@rid":"#-2:0","@version":0,"in_ownedByUser":[{"@type":"d","@version":0,"@class":"ownedByUser","out":"#96:54","in":"#45:34","@fieldTypes":"out=x,in=x"}]}

This looks like a major bug in OrientDb for me. Edge is created, out property of originating vertex is finely updated. But not the destination vertex.
Its in_edge property is stored as document rather @rid. I believe its because @rid is not available in its metadata.


Kindly help on this.

scott molinari

irakurri gabe,
2017(e)ko api. 20(a) (05:37:56)17/4/20
Hartzailea: OrientDB
The V1, V2 and e1 are 3 distinct classes. So, you have 3 distinct documents. I am guessing, the creation of an edge takes two saves to the document, thus you have 2 versions. In other words, when you look at V2, it is one document. When you look at the edge, it is a different document. (using normal and not light weight edges).

Scott

Krishnaraj H

irakurri gabe,
2017(e)ko api. 25(a) (07:16:27)17/4/25
Hartzailea: OrientDB
Thank you Scott for the reply.
Please find the Query results. Here I am creating User verted, Project Vertex and creating edge ownedByUser.
1. select * from #278:56 (Query on Edge)
{"@type":"d","@rid":"#278:56","@version":1,"@class":"ownedByUser","out":"#96:54","in":"#45:34","@fieldTypes":"out=x,in=x"}

2. select out_ownedByUser from #96:54 (Query on Project)
{"@type":"d","@rid":"#-2:0","@version":0,"out_ownedByUser":["#278:56"],"@fieldTypes":"out_ownedByUser=g"}

3. select in_ownedByUser from #45:34 (Query of User)
{"@type":"d","@rid":"#-2:0","@version":0,"in_ownedByUser":[{"@type":"d","@version":0,"@class":"ownedByUser","out":"#96:54","in":"#45:34","@fieldTypes":"out=x,in=x"}]}

This looks like a major bug in OrientDb for me. Edge is created, out property of originating vertex is finely updated. But not the destination vertex.
Its in_edge property is stored as document rather @rid. I believe its because @rid is not available in its metadata.

Please help.
Erantzun guztiei
Erantzun egileari
Birbidali
0 mezu berri