我在文档数据库中有一些链接记录:
var http = require('http');
var fs = require('fs');
var server = http.createServer(function (req, res) {
res.writeHead(200, { 'content-type': 'text/plain' })
fs.createReadStream(process.argv[3]).pipe(res);
});
server.listen(Number(process.argv[2]));
如何删除整个图表,只知道顶级MyRecord {
"@rid:": "#11:2"
...
links: ["#61:1", "#61:2", "#61:3"],
otherLink: "#62:1"
}
?
UPD
所以我想要这样的东西:
#11:2
删除所有记录:delete from ...#11:2...
答案 0 :(得分:3)
试试这个:
delete vertex MyRecord where @rid in (select @rid,out() from #21:3)
希望它有所帮助。
此致
答案 1 :(得分:2)
您可以使用一个参数(rid)
创建一个javascript函数var o=orient.getDatabase();
var b=o.query("select *,links, otherLink from " + rid);
for(i=0;i<b.length;i++){
var links= b[i].field("links");
for(j=0;j<links.length;j++){
links[j].delete();
}
b[i].field("otherLink").delete();
b[i].delete();
}
并使用此查询
select nameFunction("your rid")
希望有所帮助