[SERVER-3254] Shell does not support connection strings Created: 13/Jun/11  Updated: 29/Jan/18  Resolved: 26/May/17

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

Type: Improvement Priority: Major - P3
Reporter: Gaetan Voyer-Perrault Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

Connection string syntax is defined here:
http://www.mongodb.org/display/DOCS/Connections

The shell does not appear to support this syntax at all.

Doing something like the following throws an assertion or simply crashes the shell:

var other_server = new Mongo('mongodb://localhost:6900,localhost:6901 '); // fails
var other_server = new Mongo('mongodb://localhost:6900 '); // also fails
var other_server = connect('mongodb://localhost:6900 '); // fails



 Comments   
Comment by Mira Carey [ 26/May/17 ]

As of mongodb 3.4, the shell does support URIs

Comment by Asya Kamsky [ 05/Jan/15 ]

Mongo shell can be started using the other syntax:

mongo --host replSetName/host:port,host:port, etc

Comment by Dominik Gehl [ 04/Nov/11 ]

It would also be nice to be able to start the mongo shell with something like
mongo mongodb://localhost/?slaveOk=true

In particular the slaveOk=true part is surely useful !

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