【问题标题】:How to access results within batch statements in oriento如何在 oriento 中访问批处理语句中的结果
【发布时间】:2015-06-09 12:47:26
【问题描述】:

如何在我的第二个批处理语句中访问新插入的@rid。我需要能够从第一条语句访问@rid。

var member = {
    'email': 'test@test.com',
    'id': 200,
    'lastupdated': new Date()
};

db
    .let('insert', function (s) {
        s
            .insert().into('member')
            .set(member)
    })
    .let('update', function (s) {
        s
            .update('#12:74')
            .set({
                'from': '$insert'['@rid'] // how do I access the @rid from the previous statement
            })
    })
    .commit()
    .return('$update')
    .all()
    .then(function (results) {
        console.log(results);
    })
    .done();

【问题讨论】:

    标签: orientdb oriento


    【解决方案1】:

    几天前我遇到了同样的问题。最后发现,链接情况下的语法如下:

    .set('from=$insert')

    干杯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-23
      • 2023-04-09
      • 1970-01-01
      • 2019-03-04
      相关资源
      最近更新 更多