0

I have same ID testCaseId 'tc1' mapped with 2 requirementId 'req1' and 'req10'. This below query gives the exact match for project--proj001,req--req10 and tc--tc1. I got the solution but unable to convert this query into Spring Mongo.

db.req_tc.aggregate([  
    { $match: {'project': 'proj001'}},  
    { $project: {  
        list: {$filter: {  
            input: '$reqtclst',  
            as: 'item',  
            cond: {  
                 $and: [  
                {$eq: ['$$item.requirementId', 'req10']},  
                {$eq:['$$item.testCaseId', 'tc1']}  
            ]}              
        }}  
    }}  
])  

Thanks

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
Ramya
  • 71
  • 1
  • 1
  • 9
  • Could you add example documents to your question? – Andriy Simonov Jul 18 '16 at 17:39
  • Query in spring Mongo will be like this... Aggregation agg = newAggregation(match(Criteria.where("project").is( project))); I want full query to statisfy the above condition – Ramya Jul 19 '16 at 04:44

0 Answers0