我试图在插入顶点后在回调函数中创建一条边。下面是我使用的代码。
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);
});
但它会抛出一个错误,说 Unexpected token ILLEGAL pointing to @rid。我在这里做错什么了吗?或者是否有另一种创建边缘的方法?