Hi Michael,
try this code:
Javascript:
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);
var newData=data.toString().replace("[","['").replace(", ", "',
'").replace("]","']");
var query="update model set data = " + newData;
g.command('sql',query);
}
}
Java:
int i=2;
String newValue="querty";
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 newData=track.toString().replace("[", "['").replace(", ", "',
'").replace("]","']");
String query2="update Model set data = " + newData;
g.command(new OCommandSQL(query2)).execute();
}
}
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.