2013-10-28 3 views
0

Mongo의 집계 파이프 라인을 사용하여 다음을 집계하려는 좋은 예가 몇 가지 있습니까?MongoDB 집계 결과 합계

PriceAmt을 받고 싶습니다.

좋은 스칼라 예제가있는 좋은 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 }] 
      } 
     ] 
     } 
    } 
    ] 
} 

답변

0

공식적인 Scala 드라이버 인 Casbah는 집계 프레임 워크를 지원합니다.

documentation을 살펴보십시오.