I am trying to simulate a seat reservation flow by a student. When the student tries to reserve a seat, certain fields in two documents (student document and study space document, both from different collection) should be updated. I can connect to my database, and the study space document can get updated. However, when trying to update my student data document, I keep getting this error
MongoNetworkError: connection 6 to 34.231.146.63:27017 closed
Hi @Hui_Ying_Khoo and welcome to MongoDB community forums!!
Firstly, its always easier for us and other community users to help is all the details are posted on the same thread which avoid the toggle between two forums.
However, to understand the concern in more details, it would be helpful if you could share the following information:
What is the version of the mongoose and MongoDB you are using?
Was there any changes made to the code during this interval?
3. As mentioned in the post, the code gets stuck, can you establish the connect to the database outside the application, using shell or Compass?
4. Also, do you see any error messages during this course of retrying the write operation?
5. The IP 34.231.146.63 is the MongoDB server IP but from the screenshots attached, it seems that you are trying to make connection with Atlas. Can you confirm if this is Atlas or a local database connection?
6. Can you confirm if the update happens in the database but is not reflected in the code?
7. Finally, can you share the mongoose code where you are trying to make the connection to the database?