Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Voli: 10 top compagnie aeree per nazione(maggior numero di aeroporti legati alla nazione negli ultimi 30 gg)
- db.parsed_data.aggregate(
- {$match : {$and: [
- {$and: [{"Segments.From.Country":"IT"}, {"Segments.To.Country" :"IT" }]},
- {"SearchDate": { $gte: ISODate("2017-03-17T00:00:00.000+01:00"), $lte: ISODate("2017-04-17T00:00:00.000+01:00") }}]}}
- ,
- {$unwind: "$Segments"},
- {
- $group : {_id : "$Segments.To.Code" ,
- "company" :{$addToSet: {"carrier": "$Segments.Carrier"}},
- "TotaleVoli" : { $sum : 1 }}
- },
- {$sort : {"company" : -1}})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement