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

Mongodb doesn't work for IPv6 address.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.12.0, 3.0.0
    • 2.11.2
    • API
    • None

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: