Problem to update data with function

Hello,
I follow this example https://www.mongodb.com/developer/how-to/nextjs-with-mongodb/

but I would like to update the db with news params when I change it.
So I created a function that makes a saved button appear when you change a parameter and I would like that when you press this button it updates the db (maybe with a Onclick) I don’t no.

Do you have an idea ?