我正在尝试卷曲:
首先插入一份文件:
curl --user admin:admin -X POST -d '{"@class":"Question"}' http://127.0.0.1:2480/document/home/
{"@type":"d","@rid":"#13:3","@version":6,"@class":"Question"}
第二次插入一个文档,引用项目列表中的第一个文档
curl --user admin:admin -X POST -d '{"@class":"Question", "items":[{"@rid":"#13:3"}]}' http://127.0.0.1:2480/document/home/
{"@type":"d","@rid":"#13:2","@version":2,"@class":"Question","items":[{"@rid":"#13:3"}]}
最后我试着拿到最后一个文件:
curl --user admin:admin -X GET http://127.0.0.1:2480/document/home/13:2
{"@type":"d","@rid":"#13:2","@version":2,"@class":"Question","items":[{"@rid":"#13:3"}]}
但我需要这个:
{"@type":"d","@rid":"#13:2","@version":2,"@class":"Question","items":[{"@type":"d","@rid":"#13:3","@version":6,"@class":"Question"}]}
这是文档页面:
https://github.com/orientechnologies/orientdb/wiki/OrientDB-REST
编辑:
我尝试了这个并且没有用
curl --user admin:admin -X GET http://127.0.0.1:2480/document/home/13:2/*:-1
{"@type":"d","@rid":"#13:2","@version":2,"@class":"Question","items":[{"@rid":"#13:3"}]}
答案 0 :(得分:0)
第二个插入必须仅包含RID:
{"@type":"d","@rid":"#13:2","@version":2,"@class":"Question","items":["#13:3"]}
要检索完整的树/图表,请设置获取计划。看看:https://github.com/orientechnologies/orientdb/wiki/OrientDB-REST#get---document
使用:
curl --user admin:admin -X GET http://127.0.0.1:2480/document/home/13:2/*:-1