我正在使用OrientDB
图形数据库,我有两个顶点 Room 和 Participant,我在 Room 和 Participant 记录之间创建了一些边,我想使用orientjs
驱动程序执行以下命令:
select from (traverse out() from (select from room where name='room test 1')) where @class='Participant'
更新
我想使用这样的东西:
db.let('firstSelect', function(s){
s.select().from('room').where({name:'room test 1'});
}).let('traverse', function(s){
s.traverse('out()').from('$firstSelect').while('$depth<=1');
}).let('finalSelect', function(s){
s.select().from('$traverse').where({'@class':'Participant'});
}).commit()
.return('$finalSelect')
.all()
.then(function(participants){
console.log(participants);
})
将来我会将这段代码放在一个带有一些参数的函数中