Spring mongo集团运营

时间:2017-06-16 06:07:33

标签: spring mongodb

我们无法获得严重性......我们只能获得严重性计数。我们需要一起使用查找和组操作。

    LookupOperation lookupp = LookupOperation.newLookup()
                    .from("defect").localField("defid").foreignField("defid")
                    .as("defectsLst");


            MatchOperation match = new MatchOperation(Criteria
                    .where("projectid").is(projectid)
                    .andOperator(Criteria.where("type").is("File")));


    GroupOperation group = new GroupOperation (Fields.fields("$defectsLst.severity"))
.count().as("sevCount");


                Aggregation agg =  Aggregation.newAggregation(lookupp,
                         match,group);

0 个答案:

没有答案