Auto update/reload dashboard connected to mongodb

The easiest way to fetch new data regularly in the app is to store it in a dcc.Store component. You can combine it with dcc.Interval as input, so the callback will be triggered regularly. Just note that 1- dcc.Store data needs to be a dictionary, not a pandas DataFrame and 2- the data will be sent to the client (and back to the server if you use it as Input to other callbacks).

A related discussion can be found here, notably the part about server-side caching that might be relevant for you if you are fetching a lot of data.

1 Like