我试图在插入顶点后在回调函数中创建一条边。下面是我使用的代码。
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);
});
但这会引发错误,指出意外令牌ILLEGAL指向@rid。我在这里做错什么了吗?或是否存在创建边的替代方法?
您不能在javascript中使用@。
尝试
response[0]['@rid']
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句