Package dev.morphia

Class InsertManyOptions

    • Constructor Detail

      • InsertManyOptions

        public InsertManyOptions()
        Creates a new options wrapper
      • InsertManyOptions

        @MorphiaInternal
        public InsertManyOptions​(InsertManyOptions that)
        Parameters:
        that - the options to copy
        Since:
        2.0
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • bypassDocumentValidation

        public InsertManyOptions bypassDocumentValidation​(Boolean bypassDocumentValidation)
        Sets whether to bypass document validation.
        Parameters:
        bypassDocumentValidation - whether to bypass document validation, or null if unspecified
        Returns:
        this
        Since server release
        3.2
      • getBypassDocumentValidation

        @Nullable
        public Boolean getBypassDocumentValidation()
        Gets whether to bypass document validation, or null if unspecified. The default is null.
        Returns:
        whether to bypass document validation, or null if unspecified.
        Since server release
        3.2
      • getOptions

        public com.mongodb.client.model.InsertManyOptions getOptions()
        Returns:
        the driver version of this instance
      • getWriteConcern

        @Deprecated(since="2.0",
                    forRemoval=true)
        public com.mongodb.WriteConcern getWriteConcern()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: WriteConfigurable
        The write concern to use. By default the write concern configured for the MongoCollection instance will be used.
        Specified by:
        getWriteConcern in interface WriteConfigurable<InsertManyOptions>
        Returns:
        the write concern, or null if the default will be used.
      • writeConcern

        @Nullable
        public com.mongodb.WriteConcern writeConcern()
        Description copied from interface: WriteConfigurable
        The write concern to use. By default the write concern configured for the MongoCollection instance will be used.
        Specified by:
        writeConcern in interface WriteConfigurable<InsertManyOptions>
        Returns:
        the write concern, or null if the default will be used.
      • isOrdered

        public 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
      • ordered

        public InsertManyOptions ordered​(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