I am developing a dashboard and data is coming from MongoDB. Everything works properly but I cannot have automatic reload (internal) and I need to restart the dashboard to fetch the latest data from the database.
Also, I think callback(input, output ) cannot help me because after fetching data I will not use it directly. I use panda to make a data frame, and then I read the data frame and use some fields in the dashboard. Is there any solution to just fetch new data and then process it?
database = client["db"]
collection = database["results"]
data = pd.DataFrame(list(collection.find()))
It’s a part of my code when I want to fetch data from the database and then I use some fields in the data frame in my dashboard.