Here is the simple example connecting to your MongoDB cloud.
Before you follow this example, you need to have basic knowledge for MongoDB.
Here is the official guide:
university.mongodb.com
If you want to connect to your MongoDB, you need to enter your MongoDB username and password from the input arguments and change db name in the code.