"errors" : [
{
"level" : "ERROR",
"message" : "TEST ERROR 1",
"timestamp" : NumberLong(1538543678998)
},
{
"level" : "ERROR",
"message" : "TEST ERROR 2",
"timestamp" : NumberLong(1538543678998)
},
{
"level" : "ERROR",
"message" : "TEST ERROR 3",
"timestamp" : NumberLong(1538543678998)
}
],
这是Mongo DB中的错误的样子。我在BasicDBList中遇到“错误”。我只希望“消息”位于我的BasicDBList中,而忽略“级别”和“时间戳”
for (DBObject result : agg1.results())
{BasicDBList errors = (BasicDBList) result.get("errors"); //How to get only "message" from the BasicDBList
}
TIA