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

Incorrect javadoc signature on MongoCollection.insertMany method

    XMLWordPrintable

    Details

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

      Description

      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);
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: