Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Multiple IDs in a Transaction to a LinkSet #4968

Closed
DonKanallie opened this issue Sep 15, 2015 · 3 comments
Closed

Add Multiple IDs in a Transaction to a LinkSet #4968

DonKanallie opened this issue Sep 15, 2015 · 3 comments
Assignees
Labels

Comments

@DonKanallie
Copy link

I'm trying to add IDs from a inserted column to another inserted column in a Transaction. I tried like this:

begin
let doorOne = INSERT INTO doors SET color = green
let doorTwo = INSERT INTO doors SET color = blue
let car = INSERT INTO Cars SET doors = [$doorOne , $doorTwo]
commit retry 100
return $car
I get:

Unhandled rejection OrientDB.RequestError: The field 'Cars.doors' has been declared as LINKSET but the value is not a record or a record-id

I also tried to update it afterwards in the Transaction, but this won't work either (i think because the car is not created yet, so nothing to update) and i dont want to do it in two different calls, if there is a way to do it in one Transaction.

@lvca lvca self-assigned this Sep 18, 2015
@lvca lvca added the question label Sep 18, 2015
@lvca
Copy link
Member

lvca commented Sep 18, 2015

Use return:

let doorOne = INSERT INTO doors SET color = green RETURN @rid

@lvca lvca closed this as completed Sep 18, 2015
@DonKanallie
Copy link
Author

Still Getting the Error: Unhandled rejection OrientDB.RequestError: The field 'Cars.doors' has been declared as LINKSET but the value is not a record or a record-id

@parimal-padture
Copy link

parimal-padture commented May 31, 2017

👍

Not able to add multiple values
INSERT INTO State SET Objects = [#4:6,#45:090] RETURN @Rid

  • objects is LINKSET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants