This is the query i'm using right now :
INSERT INTO details SET name = "INITIALIZE",actionMap ={"1":12:1,"2":12:2};
Here 12:1,12:2 are rid's from another table.I'm facing a lot of problem's hardcoding these rid values.In order to avoid this i'd like to add the query like this
INSERT INTO details SET name = "INITIALIZE",actionMap ={"1":(select @rid from action where start is not null),"2":(select @rid from action where stop is not null)};
I'm getting this exception:
com.orientechnologies.orient.core.exception.OValidationException: The field 'details.actionMap' has been declared as LINKMAP but the value is not a record or a record-id
So how can i change my query to help my case.
This indeed can be done in a more gracefull way using batches.
This is just to create the object you want
INSERT INTO details SET name = "INITIALIZE"
We will turn this into
let $inserted = INSERT INTO details SET name = "INITIALIZE"
And add the edges you would like to add:
CREATE EDGE actionMap FROM $inserted TO (SELECT FROM action WHERE start is not null )
CREATE EDGE actionMap FROM $inserted TO (SELECT FROM action WHERE stop is not null )
So the entire batch you would have to run is
let $inserted = INSERT INTO details SET name = "INITIALIZE"
CREATE EDGE actionMap FROM $inserted TO (SELECT FROM action WHERE start is not null )
CREATE EDGE actionMap FROM $inserted TO (SELECT FROM action WHERE stop is not null )
If you have any more questions about this feel free to ask.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With