Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1060

Mongodb doesn't work for IPv6 address.

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.12.0, 3.0.0
    • Affects Version/s: 2.11.2
    • Component/s: API
    • None

      In mongodb/mongo-java-driver, class com.mongodb.Mongo.java don't support IPv6.
      The issue is when I use string host with ipv6 address and mongo options with method:
      @Deprecated
      public Mongo( String host , MongoOptions options )
      throws UnknownHostException {
      this( new ServerAddress( host ) , options );
      }
      -> It cannot parse IPv6 address.
      I try to customize class Mongo as:

      public Mongo( String host , MongoOptions options )
      throws UnknownHostException {
      this( new ServerAddress(InetAddress.getByName(host)) , options );
      }
      -> I can work with IPv6 address directly.

      Please give to your comment and how to fix it in this case.

      Thanks

        There are no Sub-Tasks for this issue.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            edamtrong11788 Dinh Dinh Trong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: