Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-5761

mongodb+srv: allow different service name

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • C Drivers

      Hi. Mongodb allows quering port from DNS SRV record by using mongodb+srv connection url string.

      However, the service name is _always_ `_mongdb._tcp`, which prevents from running multiple mongodb service instances in the same domain.  https://github.com/mongodb/mongo/blob/master/src/mongo/client/mongo_uri.cpp#L428

       

      Please add a setting to specify the service name to connect to for example using query url, like the following:

      mongsh mongodb+srv://example.com?service=mongodb

      mongsh mongodb+srv://example.com?service=custom-service-name

      mongsh mongodb+srv://example.com?service=custom-service-name,tag=customtag

       

      That will connect to `_mongodb._tcp.example.com` or `_custom-service-name._tcp.example.com` and `_custom-service-name,_customtag.example.com` respectively.

      Thank you.

       

      This is my first issue, I do not know to which topic to categorize it to. I tried searching the answer and found out the connection string is hardcoded. I tried searching existing issues , but I was not able to find a similar issue, I found somewhat related issues, like https://jira.mongodb.org/browse/SERVER-39008?jql=text%20~%20%22SRV%20domains%22 , https://jira.mongodb.org/browse/PYTHON-3630?jql=text%20~%20%22SRV%20domains%22 , https://jira.mongodb.org/browse/DOCS-12574 m https://jira.mongodb.org/browse/SERVER-39008 .

            Assignee:
            rishabh.bisht@mongodb.com Rishabh Bisht
            Reporter:
            kamilcukrowski@gmail.com KamilCuk N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: