Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Orientdb 插入顶点后立即在orientjs中创建边_Orientdb_Orientjs - Fatal编程技术网

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']