AVK*_*AVK 1 javascript orientdb
在OrientDB的函数中对非事务图数据库执行命令后,我想获得一个新创建的记录ID.例如,
var gdb = orient.getGraphNoTx();
var v = gdb.command("sql", "create vertex TestV set time = ?, note = ?", [(new Date().getTime()), 'note']);
//how do i refer to v.rid after creation?
return true;
Run Code Online (Sandbox Code Playgroud)
我试着像所有不同的选项,v.rid,v['@rid'],v.field('rid'),等我什至不知道从返回什么类型的对象gdb.command().
到目前为止我所知道的是返回值v的类型是object.v.toString()虽然没有提供任何有价值的见解.
有任何想法吗?
var gdb = orient.getGraphNoTx();
var v = gdb.command("sql", "create vertex TestV set time = ?, note = ?", [(new Date().getTime()), 'note']);
print(v.getRecord().field('@rid'));
return true;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1294 次 |
| 最近记录: |