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