Update dash table when select dropdown item

Hi friends, i have a 3 different collection on Mongodb. My code, It brings my data from mongodb to the dash table.
But I want it to connect to mongodb and update my data according to the option I choose from the dropdown menu.

Here is my code. Thanks for your help

And here my error :frowning: