如何使用批处理命令将LinkList插入Orient Db?

时间:2016-07-07 09:32:19

标签: orientdb

我正在尝试使用orient db中的批处理URL向表中插入一些值。

这是json string。

{"transaction":true,"operations":[{"type":"script","language":"javascript","script":"var result2= db.command(\"insert into ChatConversation set ChatID = 19,Messages = 28:119\")"}]}

但这会产生错误。

错误:

{
  "errors": [{
      "code": 500,
      "reason": 500,
      "content": "com.orientechnologies.orient.core.exception.OValidationException: The field 'ChatConversation.Messages' has been declared as LINKLIST but an incompatible type is used. Value: [#28:119]"
      }
  ]
}

请建议我解决这个问题。 提前谢谢

1 个答案:

答案 0 :(得分:1)

要将数据插入LinkList,请使用以下语法:

insert into ChatConversation(Messages) values ([#28:119,#ANOTHER_RID,#THIRD_RID])