Cannot Connect to Mongodb Database in Ubuntu Digitalocean Server

what happens when you access the site through IP and set it up but then access on subdomain afterwards.

can you connect to mongodb on the shell of the vm?