Gutter, da jeg er ny hos Mongodb, tog det mig en dag at finde en ordentlig løsning på min opgave. Jeg har en løsning på mit problem. Hvis I har en bedre forespørgsel end dette, så send den eller modificer den...
db.collections.aggregate([
{"$match":{"Corporate_ID":"id"}},
{"$unwind":"$services"},
{"$match":{"$or":[
{"services.type":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.timeSpent":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.trxID":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.CustomerQuery":{$regex:'F',"$options": "i"}},
{"services.ServiceProvided":{$regex:'F',"$options": "i"}},
{"services.Category":{$regex:'F',"$options": "i"}},
{"services.callTime":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.ActualAmount":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.FinalAmount":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.DiscountRuppes":{$regex:'TRXF2016088142',"$options": "i"}},
{"services.DiscountPerctange":{$regex:'TRXF2016088142',"$options": "i"}}
]}},
{"$unwind":"$services"},
{"$project":{
"service":"$services"}
}
])