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

Incorrect javadoc signature on MongoCollection.insertMany method

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.11.0
    • Affects Version/s: 3.9.1
    • Component/s: Documentation
    • Labels:
      None

      The @throws in the javadoc snippets below look to be incorrect. So far as I can tell these methods only ever returns a MongoBulkWriteException or a MongoException (similar to the other insertMany methods).

      MongoCollection lines 855-865
          /**
           * Inserts one or more documents.  A call to this method is equivalent to a call to the {@code bulkWrite} method
           *
           * <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
           * @param documents the documents to insert
           * @param options   the options to apply to the operation
           * @throws com.mongodb.DuplicateKeyException if the write failed to a duplicate unique key
           * @throws com.mongodb.WriteConcernException if the write failed due being unable to fulfil the write concern
           * @throws com.mongodb.MongoException        if the write failed due some other failure
           */
          void insertMany(List<? extends TDocument> documents, InsertManyOptions options);
      

      and

      MongoCollection lines 881-894
          /**
           * Inserts one or more documents.  A call to this method is equivalent to a call to the {@code bulkWrite} method
           *
           * <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
           * @param clientSession the client session with which to associate this operation
           * @param documents the documents to insert
           * @param options   the options to apply to the operation
           * @throws com.mongodb.DuplicateKeyException if the write failed to a duplicate unique key
           * @throws com.mongodb.WriteConcernException if the write failed due being unable to fulfil the write concern
           * @throws com.mongodb.MongoException        if the write failed due some other failure
           * @since 3.6
           * @mongodb.server.release 3.6
           */
          void insertMany(ClientSession clientSession, List<? extends TDocument> documents, InsertManyOptions options);
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            mark.baker-munton@mongodb.com Mark Baker-Munton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: