I have two Mongo DBs. One for my dev environment, one for production as seen here from my Robomongo setup:
The production db is SSH tunneled to my Digital O
Or if you don't want to change your code, provided that you have your ssh public key on the tunnel server, you can create a tunnel via ssh on the terminal:
ssh -fNL :: @
Example with made-up IPs connecting to a fake AWS EC2 AMI Linux
ssh -fNL 27000:101.202.10.20:27000 ec2-user@33.44.55.66
Now this mongoose.connect('mongodb://localhost:27000/mydbname'); works like a charm. ;)