[SERVER-38197] How can I specify a host and path to connect to Mongo hosted on a remote server? Created: 17/Nov/18 Updated: 21/Nov/18 Resolved: 21/Nov/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Daniel Montero | Assignee: | Danny Hatcher (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
My mongo DB is hosted a remote server is I try to connect like this: mongo -u user -p password --host my.host.net/mongo the client thinks that mongo is my DB when in fact is the path. How can I specify a different path from root? |
| Comments |
| Comment by Danny Hatcher (Inactive) [ 21/Nov/18 ] | ||||||||
|
Hello Daniel, Yes, that is correct. For more info, please refer to our documentation on the MongoDB Wire Protocol. I'm glad to hear everything is working fine for you now. Have a great day, Danny | ||||||||
| Comment by Daniel Montero [ 21/Nov/18 ] | ||||||||
|
Hi Danny, I think the problem is this: MongoDB uses a custom TCP wire protocol. It is not a HTTP endpoint. I exposed my the TCP port and now I'm able to connect without a problem. Thank you for you help! | ||||||||
| Comment by Danny Hatcher (Inactive) [ 20/Nov/18 ] | ||||||||
|
Hello Daniel, Could you provide some context on how you are trying to access MongoDB? Does the remote server's DNS resolve to my.host.net/mongo? Does it resolve to my.host.net but you are trying to do something else with /mongo? Thank you, Danny | ||||||||
| Comment by Daniel Montero [ 19/Nov/18 ] | ||||||||
|
Hey Danny, I got this:
| ||||||||
| Comment by Danny Hatcher (Inactive) [ 19/Nov/18 ] | ||||||||
|
Hello Daniel, Can you please try using percent encoding and replace the / with %2F? Your command should look like this:
If that does not work, please provide the resulting output. Thank you very much, Danny |