and now it works, I think that if there have two target, then getProperty
will return error.
var findSourFol = orient.getGraph().command("gremlin","g.V.has('name','" +
folderSo +"')");
var dfCopy = getAndCopyChild(findSourFol);
//apply the fac function
var findCoFolder = orient.getGraph().command("gremlin","g.V.has('name','" +
folderTo +"')");
if(findCoFolder === null)
{
var findCoFolder = orient.getGraph().addVertex("class:Folder");
//create the FFFF Folder
findCoFolder.setProperty('name',folderTo);
}
orient.getGraph().addEdge(null,dfCopy,findCoFolder,"isSubfolderOf");//connect
all those copy to the FFFF
/////////////////////
/////////////////////
function getAndCopyChild(folderFr)
{
var folderDe = orient.getGraph().addVertex("class:Folder");
//create the new copy Folder
folderDe.setProperty('name',folderFr.getProperty("name"));
var dpSour = [];
//find the DataPoint
var iterator1 = orient.getGraph().command("gremlin","g.V.has('@rid','" +
folderFr.getProperty("@rid") + "').out('hasPoint')");
for(var y=0; y<iterator1.length; y++){
dpSour.push(iterator1[y]);
}
for(var i=0; i<dpSour.length; i++)
//create and copy those dataPoint and addEdge to them
{
var dpArr = [];
dpArr.push(orient.getGraph().addVertex("class:DataPoint"));
dpArr[i].setProperty("name",dpSour[i].getProperty("name"));
dpArr[i].setProperty("xid",i);
orient.getGraph().addEdge(null,folderDe,dpArr[i],"hasPoint");
}
var folSour = [];
//find the SubFolder
var iterator2 = orient.getGraph().command("gremlin","g.V.has('@rid','" +
folderFr.getProperty("@rid") +"').in('isSubfolderOf')");
for(var z=0; z<iterator2.length; z++){
folSour.push(iterator2[z]);
}
if(folSour === null)
{return ;}
else
for(var j=0; j<folSour.length; j++)
//create copy addedge
{
getAndCopyChild(folSour[j]);
//factorial
orient.getGraph().addEdge(null,folSour[j],folderDe,"isSubfolderOf");//addedge
isSubfolderOf
}
return folderDe;
}
在 2015年8月21日星期五 UTC+2下午4:31:09,[email protected]写道:
>
> Hi Devin,
>>
>
> 1) Which version are you using?
> 2) Can you please post the code that gives you the error?
> 3) Which language you used for the function?
>
> Regards,
> Michela
>
>
--
---
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.