orientjs icon indicating copy to clipboard operation
orientjs copied to clipboard

Unable to set more RIDs from variables to LINKSET field using transactions

Open petervavro opened this issue 7 years ago • 1 comments

Here is my SQL returned from trx.toString() :

LET oOperationalDays0 = (CREATE vertex OperationalDays SET weekday = 0, active = true),
oOperationalDays1 = (CREATE vertex OperationalDays SET weekday = 1, active = true),
o_Service = (CREATE vertex Service SET notes = "Service Notes", time = "12:30", inOperation = list($oOperationalDays0) || list($oOperationalDays1), stops = [#61:143,#62:143,#63:143], active = true)

It works but...

Let's focus on following part where I am setting "inOperation" (LINKSET) : inOperation = list($oOperationalDays0) || list($oOperationalDays1)

ISSUE : It won't save both RID, only the first one.

In OrientDB studio the query above does not work so I have to adjust it the following way :

begin;
LET oOperationalDays0 = CREATE vertex OperationalDays SET weekday = 0, active = true;
LET oOperationalDays1 = CREATE vertex OperationalDays SET weekday = 1, active = true;
LET o_Service = CREATE vertex Service SET notes = "Service Notes", time = "12:30", inOperation = list($oOperationalDays0) || list($oOperationalDays1), stops = [#61:143,#62:143,#63:143], active = true;
commit;

This works without issue, both RIDs are saved.

Can anyone help me with this one please ?

petervavro avatar Aug 14 '18 19:08 petervavro

OK, I am sorry but I just found solution :

inOperation = [$oOperationalDays0,$oOperationalDays1] works well.

My confusion was most probably caused by possible bug in OrientDB I have mentioned here.

Processing the SQL query in OrientDB Studio won't work, but here it does.

Thanks.

petervavro avatar Aug 14 '18 20:08 petervavro