Class InsertManyOptions


  • public class InsertManyOptions
    extends java.lang.Object
    The options to apply to an operation that inserts multiple documents into a collection.
    Since:
    3.0
    MongoDB documentation
    Insert Tutorial
    Insert Command
    • Constructor Detail

      • InsertManyOptions

        public InsertManyOptions()
      • InsertManyOptions

        public InsertManyOptions​(JsonObject json)
    • Method Detail

      • setOrdered

        public InsertManyOptions setOrdered​(java.lang.Boolean ordered)
        Sets whether the server should insert the documents in the order provided.
        Parameters:
        ordered - true if documents should be inserted in order
        Returns:
        this
      • isOrdered

        public java.lang.Boolean isOrdered()
        Gets whether the documents should be inserted in the order provided, stopping on the first failed insertion. The default is true. If false, the server will attempt to insert all the documents regardless of an failures.
        Returns:
        whether the the documents should be inserted in order
      • setBypassDocumentValidation

        public InsertManyOptions setBypassDocumentValidation​(java.lang.Boolean bypassDocumentValidation)
        Sets the bypass document level validation flag.
        Parameters:
        bypassDocumentValidation - If true, allows the write to opt-out of document level validation.
        Returns:
        this
        Since:
        3.2
        Since server release
        3.2
      • isBypassDocumentValidation

        public java.lang.Boolean isBypassDocumentValidation()
        Gets the the bypass document level validation flag
        Returns:
        the bypass document level validation flag
        Since:
        3.2
        Since server release
        3.2