The docs for AsyncIOMotorCursor mention that there should be an explain method but it doesn't exist with AsyncIOMotorLatentCommandCursor.
I get the error:
'AsyncIOMotorLatentCommandCursor' object has no attribute 'explain'
Code
weather = mongo.weather.aggregate([ { "$geoNear": { "near": { "type": "Point", "coordinates": [float(ice_out['lon']), float(ice_out['lat'])] }, "distanceField": "distance", "spherical": True, "limit": 10000000000, "query": { "time": {"$gt": start, "$lte": end}, "snow": {"$ne": 'M'}, } } }, { "$group": { "_id": "$time", "weather": {"$first": "$$ROOT"} } }, {"$sort": {"_id": -1}} ]) print(await weather.explain())