db.createCollection( "weather24h1", { timeseries: { timeField: "timestamp", metaField: "metadata", granularity: "minutes" }, expireAfterSeconds: 86400 } ) db.weather24h1.insertMany( [ { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-28T00:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-28T01:00:00.000Z"), "temp": 11 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-28T00:10:00.000Z"), "temp": 11 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-28T00:11:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-28T00:12:00.000Z"), "temp": 16 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-29T20:00:00.000Z"), "temp": 15 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-27T00:00:00.000Z"), "temp": 13 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-27T04:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-29T08:00:00.000Z"), "temp": 11 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-29T12:00:00.000Z"), "temp": 12 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-29T16:00:00.000Z"), "temp": 17 }, { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2023-08-29T20:00:00.000Z"), "temp": 12 } ] )