How to modify a LINKSET after initial vertex creation

44 views
Skip to first unread message

Bill Blondin

unread,
Jun 25, 2015, 9:19:13 AM6/25/15
to orient-...@googlegroups.com
I have a simple model:

App   ---users--->   User
.xOut

where App has a LINKSET property, "xOut".


xOut is intended to contain a collection of "users" edge RID values.



No matter what I do, I can only set the xOut collection when I create a new vertex record.  Once that initial value is set, I can not add to it.


This syntax will create a new record and set the collection:

create vertex App set Name="app2", xOut=[#14:0]

None of the following will do anything to change the xOut collection:

update App add app.xOut = [#14:1] where @rid=#12:1
update #12:1 add app.xOut = [#14:1]

Explicit reset of the collection seems to work, but it's not a great solution if the list is long:

update App set xOut = [#14:1] where @rid=#12:1 
update #12:1 xOut = [#14:1]
 

The statements all appear to execute, but when I SELECT FROM App, I just get back the initial values that were saved when the vertex was created when using the "add" statements.

Am I missing something?

Bill 

alessand...@gmail.com

unread,
Jun 25, 2015, 10:15:45 AM6/25/15
to orient-...@googlegroups.com
Hi Bill,
which version of OrientDb are you using?

Alessandro

Bill Blondin

unread,
Jun 25, 2015, 10:19:34 AM6/25/15
to orient-...@googlegroups.com
latest production 2.0.11

alessand...@gmail.com

unread,
Jun 25, 2015, 10:25:56 AM6/25/15
to orient-...@googlegroups.com
Hi Bill,
if you use orientdb-2.1-rc3, the following instructions work

update App add xOut = [#14:1] where @rid=#12:1
update #12:1 add xOut = [#14:1]

Alessandro

Bill Blondin

unread,
Jun 25, 2015, 11:09:27 AM6/25/15
to orient-...@googlegroups.com
Thanks, I'll give it a try on the rc version

Bill Blondin

unread,
Jun 25, 2015, 11:54:50 AM6/25/15
to orient-...@googlegroups.com
Just installed latest rc version (2.1 rc4), and now I receive the following errors when attempting to execute the following statements:

update #13:0 add xOut=#16:1
 Error on parsing command at position #21: Found unexpected keyword '=#16:1' while it was expected '[=]'.  
 
update #13:0 add User.xOut=#16:1
Error on parsing command at position #26: Found unexpected keyword '=#16:1' while it was expected '[=]'. 

update User add User.xOut=#16:1 where @rid=#13:0
 Error on parsing command at position #25: Found unexpected keyword '=#16:1' while it was expected '[=]'. 

update User add xOut=#16:1 where @rid=#13:0
Error on parsing command at position #20: Found unexpected keyword '=#16:1' while it was expected '[=]' 

update #13:0 add xOut=[#16:1]
Error on parsing command at position #21: Found unexpected keyword '=[#16:1]' while it was expected '[=]'. 

update #13:0 add User.xOut=[#16:1]
Error on parsing command at position #26: Found unexpected keyword '=[#16:1]' while it was expected '[=]'. 

update User add xOut=[#16:1] where @rid=#13:0
Error on parsing command at position #20: Found unexpected keyword '=[#16:1]' while it was expected '[=]'. 

alessand...@gmail.com

unread,
Jun 25, 2015, 12:05:29 PM6/25/15
to orient-...@googlegroups.com
Hi Bill,
I try the query from the browse in Visual Studio and it works.

Alessandro

Bill Blondin

unread,
Jun 25, 2015, 12:42:49 PM6/25/15
to orient-...@googlegroups.com
see attached
Linkset-Add.png

alessand...@gmail.com

unread,
Jun 26, 2015, 5:29:28 AM6/26/15
to orient-...@googlegroups.com
Hi,
I have tried with version (2.1 rc4) and the query works ( see attached)

Alessandro














Bill Blondin

unread,
Jun 26, 2015, 7:22:24 AM6/26/15
to orient-...@googlegroups.com
Perhaps there was an install issue on my end. I will try again.
Reply all
Reply to author
Forward
0 new messages