// mongoDB query for config07.json db.covid.aggregate( {$match:{state: {$in: ["CA", "WA", "OR"]}}}, // "target" is three states {$match:{date: {$gte: 20200501, $lte: 20200505}}} // assuming query is run on May 5 {$project: {state:"$state", date:"$date", death: "$death"}}, // cosmetic step based on analysis.tasst.track value {$group: {_id: "$date", deaths: {$sum: "$death"} //aggregation level is "usa" - we removed some states, but need to add up } // the values from the remaining states }, {$project: {state:"$_id", deaths: "$death", _id:0}} // cosmetic step ) // output: // graph is a bar chart of total number of deaths for the three states combined over time. // table has one row, with each date being a single column: // // ... //CA,WA,OR ... //
May 1May 2May 5
deaths on May1 deaths on May 2 deaths on May5
// //