Document how to use connection string with multiple credentials

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.0.0
    • Component/s: Documentation
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The MongoClient constructor in Java currently has:

      MongoClient(MongoClientURI uri)
      MongoClient(List<ServerAddress> seeds, List<MongoCredential> credentialsList, MongoClientOptions options
      

      The former allows connecting using a URI, which is standard and supported by all drivers, but doesn't support custom credentials per database.

      Previously we had API like:

      mongoClient.getDB(dbname).authenticate(...)
      

      ... authenticate seems to have been removed from the 3.x Java driver. But is still avail in other drivers (e.g. pymongo).

      We've read:
      http://mongodb.github.io/mongo-java-driver/3.2/driver/reference/connecting/authenticating/
      https://docs.mongodb.org/manual/reference/connection-string/

      But this seems to deal with single credentials for a Mongo instance.

      What's the recommended way of using multiple database credentials with the Java driver?

              Assignee:
              Unassigned
              Reporter:
              James Blackburn
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: