Alessandro,

Thanks for the information.  I think this work around will help us for now. 
 The only issue I see is that it looks like the entire array / list must be 
loaded. I think for relatively small arrays (lists) this would work well. 
 We may have large lists, with the values in the list themselves being 
complex objects.  In the long term loading all of that data may not be 
feasible to simply replace one value in the list.

Again, thanks for the work around.

~Michael

On Tuesday, August 4, 2015 at 4:32:40 AM UTC-6, [email protected] wrote:
>
> Hi Michael,
> I have the same problem
>
> I created a function javascript or java code to solve the problem
>
> JavaScript function :  parameter = "i" and "newValue"
>
> var g=orient.getGraph();
> var b=g.command('sql','select from model');
> var values="[";
> for(j=0;j<b.length;j++){
>   var data=b[j].getProperty('data');
>   var size=data.size();
>   if(i<size && i>=0){
>     data.set(i,newValue);
>   for(k=0;k<size;k++){
>       if(k==0)
>           values=values + "'"+data.get(k)+ "'";
>       else
>           values=values + ",'" + data.get(k) + "'";
>     }
>     values=values + "]";
>     var query="update model set data = " + values;
>     g.command('sql',query);
>   }
> }
>
>
>
> <https://lh3.googleusercontent.com/-vBAYeWutR6Y/VcCUgaaU7iI/AAAAAAAAAEA/9SM4uaF-NJw/s1600/model.png>
>
>
> Java
>
> OrientGraph g=new OrientGraph(currentPath);
> int i=1;
> String newValue="qwerty";
> Iterable<OrientVertex> result=g.command(new 
> OSQLSynchQuery<OrientVertex>("select from Model")).execute();
> for(OrientVertex v:result){
> OTrackedList<String> track=v.getProperty("data"); 
> if(i<track.size() && i>=0){
> track.set(i,newValue);
> String values="[";
> for(int k=0;k<track.size();k++){
> if(k==0)
> values+="'"+track.get(k)+ "'";
> else
> values+=",'" + track.get(k) + "'";
> }
> values+="]";
> String query="update Model set data = " + values;
> g.command(new OCommandSQL(query)).execute();
> }
> }
> g.shutdown();
>
> Regards,
> Alessandro
>

-- 

--- 
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.

Reply via email to