Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.parsed_data.aggregate(
- {$unwind: "$Segments"}
- ,
- {$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") }}]}}
- ,
- {
- $group : {_id : "$Segments.From.City" , "total" : { $sum : 1 }}//_id : "$Origin.Code"
- },
- {
- $sort : {total : -1}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement