1) my orientdb version is 2.0.12
2)my code is
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");//copy
all those 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
dpSour.push( orient.getGraph().command("gremlin","g.V.has('@rid','" +
folderFr.getProperty("@rid") + "').out('hasPoint')"));
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
folSour.push(orient.getGraph().command("gremlin","g.V.has('name','" +
folderFr.getProperty("name") +"').in('isSubfolderOf')"));
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;
}
3)I use the javaScript
Thanks:)
Best Regards
Devin
在 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.