【发布时间】:2017-02-20 01:56:13
【问题描述】:
我在名为 test 的集合中有以下文档:
[
{
"_key": "2469",
"_id": "test/2469",
"_rev": "_Ujegqfu---",
"fieldName": "some value"
}
]
我正在使用以下两种方法检索它:
public Result helloWorldJson() {
ArangoDB db = new ArangoDB.Builder().user("<user>").password("<pass>").build();
VPackParser parser = new VPackParser() ;
VPackSlice slice = db.db("<db>").collection("test").getDocument("2469", VPackSlice.class);
String json = db.db("cms").collection("test").getDocument("2469", String.class);
return Results.text().render("{velocy: " + parser.toJson(slice, true) + ", json: " + json);
}
产生这个输出:
{velocy: {"_key":"2469","_id":null,"_rev":"_Ujegqfu---","fieldName":"some value"}, json: {"_key":"2469","_id":"test\/2469","_rev":"_Ujegqfu---","fieldName":"some value"}
VPackParser 是故意将_id 留空还是我遗漏了什么?
【问题讨论】: