Details
-
Improvement
-
Resolution: Won't Fix
-
Minor - P4
-
None
-
None
-
None
Description
Relevant documentation: https://docs.mongodb.com/manual/reference/connection-string/#replica-set-option
To tell a driver to connect to a list of nodes as a replicaset - such as when I want to use transactions - I need to use replicaSet=myrs option in the MongoDB URL, where "myrs" is the name of the replicaset.
For easily copypasteable examples, it's unfortunate that there is no meaningful default value for the replica set name. For example, I can assume that on most people's laptops, this URL will work:
mongodb://localhost:2017/test
|
However, this probably won't:
mongodb://localhost:2017/test?replicaSet=replset
|
I would like to have the option to say "this is a replica set but I don't care about the name". As a strawman suggestion, using 1 for true (and 0 for false) I could:
mongodb://localhost:2017/test?replicaSet=1
|