Hi @Adrian_Galvez_G and welcome to the community!
Sorry to hear your first project with MongoDB resulted in getting your database attacked. MongoDB has a security checklist to help make your database secure. This might be more than you need however at this time if you’re just working through a test project that won’t be sticking around.
For a test system like this, you can do a couple of things to make it secure enough:
- Enable authentication and access control
- Set your server’s firewall to only allow access from certain machines. I’m not sure how to do this on DO unfortunately, but there should be a way to set it up so only your local machine can access the DO server. My guess is that it is currently set up to allow access from any host (IP 0.0.0.0).