我正在尝试使用 NodeJS 服务器上的 OrientJS 框架将对象保存到数据库中。该对象包含一些本机参数以及应该指向另一个类的记录的 RID 数组。看到这个:
var myObj = {
name: 'myNewObjectName',
'@class': 'OuterClass',
parameter: ['#225:13']
}
在 OrientDB 类中,“参数”字段被定义为 LINKLIST。但是,当我尝试为此对象创建新记录时:
db.record.create(myObj).then(function(record){
console.log(record);
});
我得到了例外:
Unhandled rejection OrientDB.RequestError: For input string: "#225" at child.Operation.parseError (C:\Users\...\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:864:13)
at child.Operation.consume (C:\Users\...\node_modules\orientjs\lib\transport\binary\protocol33\operation.js:455:35)
at Connection.process (C:\Users\...\node_modules\orientjs\lib\transport\binary\connection.js:399:17)
at Connection.handleSocketData (C:\Users\...\node_modules\orientjs\lib\transport\binary\connection.js:290:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
那么不知何故,集群后面的 ID 没有通过?我做错了什么,还是这是一个错误?我还能做什么?
非常感谢你的帮助!