Orientdb 插入顶点后立即在orientjs中创建边
我试图在插入顶点后在回调函数中创建一条边。 下面是我使用的代码Orientdb 插入顶点后立即在orientjs中创建边,orientdb,orientjs,Orientdb,Orientjs,我试图在插入顶点后在回调函数中创建一条边。 下面是我使用的代码 db.query('insert into Post content :Post',{ params: { Post: post } }).then(function(response){ db.query('create edge from :PostId to :UserId',{ params: {
db.query('insert into Post content :Post',{
params: {
Post: post
}
}).then(function(response){
db.query('create edge from :PostId to :UserId',{
params: {
PostId : response[0].@rid,
UserId : req.body.userid;
}
}).then(function(result){
console.log('create edge'+result);
});
return res.json(response);
});
但它抛出一个错误,指出指向@rid的意外令牌非法。我做错什么了吗?
或者是否有其他方法来创建边缘?您不能在javascript中使用@ 试一试
response[0]['@rid']