Allow replicaSet=1 in MongoDB URLs

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Component/s: None
    • None

      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
      

            Assignee:
            Bernie Hackett
            Reporter:
            Henrik Ingo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: