I’m trying to connect to mongo from app, using mongoose. I’m connected to the server using openVPN and have server username, password and also SSH username and password, address and port. I can’t connect to the database. What type of connection string should I use ?
Ideally the port should be available on the network so only VPN connection would be required.
If you still need to use ssh as well then configure a SSH port forwarding and use that. If a replicaset is in use then set the port forward to the primary and specify directConnection=true on the connection string.