This is how I’ve done it.
MongoDB Setup:
- Go to MongoDB Atlas and Create an Account
- Create a Free Shared Cluster, customizing the location and name if you wish
- Wait for the cluster to be created → Usually about 5 minutes
- Go to Database Access, create a new user with a password (copy and paste this somewhere) and give the user read/write previlages
- Go to Clisters, Click Collection, Click Add my Own Data, and Create a Database and Collection, note down the database name
- Go to Network Access, Add IP Address, and allow access from anywhere
- Go to Clusters, Connect, Choose ‘Connect with App’, Copy the URI and paste it somewhere
- Edit the URI, to replace the database name and password.