[SERVER-2422] "db" returns hostname when connecting to remote host Created: 27/Jan/11  Updated: 27/Jan/11  Resolved: 27/Jan/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 1.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Adrien Mogenet Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

$ ./mongo my-host

MongoDB shell:
> db
my-host

(In my sharded case, it also created a db "my-host" ...

I think it could just display error "please select a db"



 Comments   
Comment by Adrien Mogenet [ 27/Jan/11 ]

In that case, maybe name resolving should be disabled ?

$ ./mongo datastore

It might be confusing if both db and host have been named "datastore".
Ok, user can type :

$ ./mongo --host datastore

to make it less ambiguous, but the raw URL pattern without explicit option is still confusing .
Well, I will work on another more important issue, that was mostly an opportunity to learn MongoDB source code.

Comment by Scott Hernandez (Inactive) [ 27/Jan/11 ]

Unfortunately this is a known issue. If the name doesn't resolve to an address (ip) then it is considered a database name.

Many people do this: "mongo mydb", and expect it to work, as it does now.

Your suggestion would break existing functionality

Comment by Adrien Mogenet [ 27/Jan/11 ]

It's not a technical bug but a not logical behavior according to me.

Generated at Thu Feb 08 02:59:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.