On在Oriendb(2.1.2)中执行以下查询时,@ rid返回否定rid并且实际摆脱存在于rid键中。请参阅下面的更多解释
子查询:
select @rid from actions
OP:
{
"result": [
{
"@type": "d",
**"@rid": "#-2:0",**
"@version": 0,
**"rid": "#12:24",**
"@fieldTypes": "rid=x"
}
],
"notification": "Query executed in 0.026 sec. Returned 1 record(s)"
}
主要查询:
INSERT INTO activityDetails SET name = "Dummy",actionMap ={"1":(**select @rid from action where start is not null**-->Returns a invalid Rid),"2":(select * from action where stop is not null)};
OP:
com.orientechnologies.orient.core.exception.OValidationException: The field 'activityDetails.actionMap' has been declared as LINKMAP but the value is not a record or a record-id
如何在子查询中替换rid取代@rid?
答案 0 :(得分:1)
负RID意味着是暂时的。提交事务时,在提交RID更改并在对象中更新后,将为此beacause分配一个真实的RID。
进行插入时,只会从选择中返回一条记录?你可以通过选择“限制1”来进行测试