[SERVER-3300] MongoURI support for connecting to a db via the shell Created: 20/Jun/11  Updated: 15/Jun/15  Resolved: 15/Jun/15

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

Type: Improvement Priority: Minor - P4
Reporter: Ryan Nitz Assignee: Unassigned
Resolution: Duplicate Votes: 10
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6233 Support MongoDB URIs as mongo shell a... Closed
is duplicated by SERVER-8846 Command line shell should support URIs Closed
is duplicated by SERVER-9449 enable passing a uri to the mongo cli Closed
is duplicated by SERVER-14686 Shell should be able to connect to re... Closed
Related
Participants:

 Description   

It would be more consistent with the drivers if the shell supported URIs, in addition to --host replSetName/seed-list format it already supports.

E.g.

mongo mongodb://test:test@127.0.0.1:27017/test



 Comments   
Comment by Ramon Fernandez Marina [ 15/Jun/15 ]

Duplicate of SERVER-6233.

Comment by Asya Kamsky [ 25/Jul/14 ]

Currently (in all recent versions) the shell does support connecting to a replica set:

mongo --host replSetName/seed-list

This ticket is for shell to support the more standard URI option as the host format is not aligned with format all the drivers use/understand.

Comment by Jon Stevens [ 24/Apr/13 ]

Yes, it would be amazing to be able to just copy/paste a basic uri per the original posters description.

Comment by Jacques Crocker [ 13/Dec/11 ]

a --uri option would be AMAZING

Comment by Ryan Nitz [ 20/Jun/11 ]

Btw - right now here is what I get if if run this:

     [exec] Mon Jun 20 16:58:54   Assertion failure _setName.size() 32bit/client/dbclient.h 143
     [exec] 0xab097 0xbedec 0xee902 0x14b5d6 0x1c9b8f 0x1cb3ab 0x1d5413 0x1ca565 0x18b8f9 0x18b850 0x18b75a 0x155f0f 0x2139a 0x13bd89 0x9a42 0xbe53 0x2116 0x3 
     [exec]  0   mongo                               0x000ab097 _ZN5mongo12sayDbContextEPKc + 199
     [exec]  1   mongo                               0x000bedec _ZN5mongo8assertedEPKcS1_j + 300
     [exec]  2   mongo                               0x000ee902 _ZN5mongo16ConnectionString5parseERKSsRSs + 1602
     [exec]  3   mongo                               0x0014b5d6 _ZN5mongo26mongo_external_constructorEP9JSContextP8JSObjectjPlS4_ + 246
     [exec]  4   mongo                               0x001c9b8f js_Invoke + 3275
     [exec]  5   mongo                               0x001cb3ab js_InvokeConstructor + 702
     [exec]  6   mongo                               0x001d5413 js_Interpret + 40685
     [exec]  7   mongo                               0x001ca565 js_Execute + 774
     [exec]  8   mongo                               0x0018b8f9 JS_EvaluateUCScriptForPrincipals + 167
     [exec]  9   mongo                               0x0018b850 JS_EvaluateUCScript + 67
     [exec]  10  mongo                               0x0018b75a JS_EvaluateScript + 108
     [exec]  11  mongo                               0x00155f0f _ZN5mongo7SMScope4execERKNS_10StringDataERKSsbbbi + 511
     [exec]  12  mongo                               0x0002139a _ZN5mongo10shellUtils9initScopeERNS_5ScopeE + 282
     [exec]  13  mongo                               0x0013bd89 _ZN5mongo12ScriptEngine8newScopeEv + 41
     [exec]  14  mongo                               0x00009a42 _Z5_mainiPPc + 4850
     [exec]  15  mongo                               0x0000be53 main + 51
     [exec]  16  mongo                               0x00002116 start + 54
     [exec]  17  ???                                 0x00000003 0x0 + 3

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