[SERVER-50132] Implement topology discovery in shell Created: 05/Aug/20 Updated: 06/Dec/22 Resolved: 06/Oct/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Oleg Pudeyev (Inactive) | Assignee: | Backlog - Server Tooling and Methods (STM) (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Server Tooling & Methods
|
||||
| Participants: | |||||
| Description |
|
Drivers provide two ways to discover the topology of a deployment and connect to it appropriately:
mongo mongodb://localhost:14420,localhost:14421
It seems to me that mongo shell does not implement either of these behaviors. Specifically, there appears to be no way to connect to replica set using mongo shell without providing the replica set name. The decision across drivers was to implement topology discovery by default. New drivers must implement it, existing drivers can continue with their existing behavior for BC reasons. To improve usability of the shell and make it consistent with drivers, I suggest implementing one or both of the above mentioned ways of discovering and connecting to replica set without specifying replica set name explicitly. |
| Comments |
| Comment by Robert Guo (Inactive) [ 06/Oct/20 ] |
|
Hi Oleg, Thank you for the insight. I understand the frustration that the shell does not behave like drivers in certain respects like topology discovery and does not provide the best experience for mongo shell users. The new shell (mongosh) is in fast active development and I would encourage you to reach out to see if topology discovery is something they could prioritize, or better yet, something they've already done. The old shell is going to be deprecated in the near future and to be used exclusively for Server development; we expect it will continue to have behavior that deviates from other drivers. |
| Comment by Oleg Pudeyev (Inactive) [ 22/Sep/20 ] |
|
brooke.miller I suppose what is not mentioned in the original description is that I use mongo shell as a user of MongoDB. As such, as a user of MongoDB, I would like the shell to perform topology discovery:
I understand that shell is also used by server engineers for various testing purposes and to that effect there are various helpers and tools implemented in the shell that do various things. If I need to perform complex testing, I would ordinarily do it using drivers I am familiar with (such as the Ruby one). The request here is for the shell to perform topology discovery in ordinary user-centric use cases, such as connecting to a deployment which happens to be a replica set to run commands. For example, if I want to issue stepdown:1 from the shell, I must provide RS name in the URI. The stepdown:1 command uses the documented runCommand API and does not use any internal shell helpers and such. |
| Comment by Brooke Miller [ 22/Sep/20 ] |
|
Any update on your end, oleg.pudeyev? |
| Comment by Brooke Miller [ 10/Sep/20 ] |
|
oleg.pudeyev, did you get a chance to review Judah's comment above? |
| Comment by Judah Schvimer [ 31/Aug/20 ] |
|
Does this javascript library meet your needs? |