Currently, I am experimenting with nodeJS and encountering an error when trying to establish a connection to the MongoDB Client. I have implemented promises for improved readability but am facing issues connecting. The code involves connecting to the database, inserting a document, retrieving entries, and then cleaning the database by dropping the collection. However, the connection is failing, and I'm unsure of the mistake in my approach. Here is the snippet of my code:
// The code snippet goes here
// More code goes here
Upon attempting to connect to the server, the error message I receive is as follows:
// The error details go here
// More error information here
The expected output should resemble the image linked below: