Unable to View Data in MongoDB Compass Despite Successful Queries via Flask App

I am facing the same issue with my project as well, It is built using FastAPI server.
I am sending the data to the MongoDB and also retrieving it successfully but the data is not visible either in MongoDB Compass as well as the atlas .