有没有一些很好的例子,我想在 Scala 中使用 Mongo 的聚合管道聚合以下内容。
想得到总和PriceAmt
。
任何带有一些很棒的 Scala 示例的好的 URL 都会有很大的帮助。以下是从 MongoDB 中检索到的 JSON。
{
"_id": ObjectId("5269723bd516ec3a69f3639e"),
"Id": ObjectId("5269723ad516ec3a69f3639d"),
"results": [
{
"Id": "526971f5b5b8b9148404623a",
"pricingResult": {
"TxId": 0,
"PriceId": "Large_Batch_1",
"Errors": [ ],
"Disposition": [
{
"GroupId": 1,
"PriceAmt": 20,
"Status": "Priced Successfully",
"ReasonCode": 0,
"PricingMethodologyId": 2,
"Lines": [{ "Id": 1 }]
}
]
}
},
{
"ClaimId": "526971f4b5b8b91484046229",
"pricingResult": {
"TxId": 0,
"PriceId": "Large_Batch_1",
"Errors": [ ],
"Disposition": [
{
"GroupId": 1,
"PriceAmt": 20,
"Status": "Priced Successfully",
"ReasonCode": 0,
"PricingMethodologyId": 2,
"Lines": [{ "Id": 1 }]
}
]
}
}
]
}