skip to Main Content

MongoDB collect / aggregate time series into an array

Following the examples I have two types of data in the same time series db.weather.insertMany( [ { "metadata": { "sensorId": 5578, "type": "temperature" }, "timestamp": ISODate("2021-05-18T00:00:00.000Z"), "temp": 72 },//.... and.. db.weather.insertMany([ { "metadata": {"sensorId": 5578, "type": "humidity" }, "timestamp": ISODate("2021-05018T00:00:001Z"),…

VIEW QUESTION

Mongodb – Python: 'NoneType' object is not subscriptable

Asking for some help on this one. def home(request): client = pymongo.MongoClient(settings.MONGO_SERVER) main_db = client[settings.MONGO_DATABASE] get_main_config = main_db.configurations.find_one({"name": "main_config"}) return render(request, 'dashboard/home.html', {"data": get_main_config["homepage_urls"]}) Traceback (most recent call last): render(request, 'dashboard/home.html', {"data": get_main_config["homepage_urls"]}) TypeError: 'NoneType' object is not subscriptable Why…

VIEW QUESTION
Back To Top
Search