Lab09-Time Series Collections
Lab09-Time Series Collections
2. Make sure you have a local MongoDB instance running (see lab #2) or use the
remote MongoDB Atlas instance (see lab #1). You'll need at least MongoDB v5 for
this lab.
6. Create the time series collection to hold the historic weather data
> db.createCollection(
"timisoara",
{
timeseries: {
timeField: "timestamp",
granularity: "hours"
}
}
)
6. Import the weather sample data (make sure you run this at the command prompt,
not inside the Mongo Shell)
mongoimport --db=weather --collection=timisoara
mongodb://mongoadmin:secret@localhost:27888/?authSource=admin
timisoara_2020_weather.json
DO IT YOURSELF:
A. Get average temperature for each month in the data sample.
B. Display the previous list in descending order of the average temperatures.
NEXT:
It's about time to check whether you master MongoDB.
Next time we'll see the project that will get you the grade for this semester. For
now just relax.