Awesome! makes sense.
Thanks Craig!
On Tuesday, March 24, 2015 at 2:06:52 PM UTC+1, Ivan Plaza wrote:
>
> Hi
>
> I'm having an issue committing changes to an array field with gremlin and
> orientdb. It seems updates to embedded lists are ignored.
>
> I have an edge that contains an array. If I push a new value to the array
> and commit the change, the new value does not show in the database.
>
> However, if I push a new value to the array and also set another field,
> then commit, the array values appear.
>
> Here's the sequence:
>
> (create 2 vertices)
> gremlin> v1 = g.addVertex();
> ==>v[#-1:-2]
> gremlin> v2 = g.addVertex();
> ==>v[#-1:-3]
> gremlin> g.commit()
> ==>null
>
> (create the edge between two vertices with array)
> g.addEdge(v1,v2,"Friend",["array":["one"]])
> gremlin> g.e("#13:0")
> ==>e[#13:0][#9:3-Friend->#9:4]
>
> (now push a new value to the array and commit the change)
> gremlin> g.e("#13:0").getProperty("array").push("two")
> ==>true
> gremlin> g.e("#13:0").getProperty("array")
> ==>one
> ==>two
> gremlin> g.commit()
>
> (now reconnect to see if the update was saved)
> gremlin> g = new
> OrientGraph("remote:/orientdb-community-2.0.5/databases/test");
> gremlin>
> g.e("#13:0").map
>
>
> ==>{array=[one]}
> (nope, array only has one value)
>
> (now lets try updating the array and another field)
> gremlin>
> g.e("#13:0").getProperty("array").push("two")
>
>
> ==>true
> gremlin> g.e("#13:0").map
> ==>{array=[one, two]}
> gremlin> g.e("#13:0").delta=1
> ==>1
> gremlin>
> g.commit()
>
>
> ==>null
>
> (now reconnect )
> gremlin> g = new
> OrientGraph("remote:/orientdb-community-2.0.5/databases/test");
>
> ==>orientgraph[remote:/Users/yvan/dev/orientdb-community-2.0.5/databases/test]
> gremlin>
> g.e("#13:0").map
>
>
> ==>{array=[one, two], delta=1}
> (yep, we got two values now but we were forced to set another field)
>
> Any ideas ??
> I posted this in both orientdb and gremlin groups as I dont know where the
> issue lies
> Gremlin Version: 2.6.0
> OrientDB Version: 2.0.5
>
>
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.