Package dev.morphia

Class InsertOptions

  • All Implemented Interfaces:
    dev.morphia.internal.CollectionConfiguration, dev.morphia.internal.WriteConfigurable

    @Deprecated(since="2.0",
                forRemoval=true)
    public class InsertOptions
    extends Object
    implements dev.morphia.internal.WriteConfigurable
    Deprecated, for removal: This API element is subject to removal in a future version.
    Options related to insertion of documents into MongoDB. The setter methods return this so that a chaining style can be used.
    Since:
    1.3
    • Constructor Detail

      • InsertOptions

        public InsertOptions()
        Deprecated, for removal: This API element is subject to removal in a future version.
    • Method Detail

      • getBypassDocumentValidation

        @Deprecated(forRemoval=true,
                    since="2.3")
        public Boolean getBypassDocumentValidation()
        Deprecated, for removal: This API element is subject to removal in a future version.
        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
      • isOrdered

        @Deprecated(forRemoval=true,
                    since="2.3")
        public boolean isOrdered()
        Deprecated, for removal: This API element is subject to removal in a future version.
        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 documents should be inserted in order
      • writeConcern

        public InsertOptions writeConcern​(WriteConcern writeConcern)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Set the write concern to use for the insert.
        Specified by:
        writeConcern in interface dev.morphia.internal.WriteConfigurable
        Parameters:
        writeConcern - the write concern
        Returns:
        this
      • bypassDocumentValidation

        public InsertOptions bypassDocumentValidation​(Boolean bypassDocumentValidation)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets whether to bypass document validation.
        Parameters:
        bypassDocumentValidation - whether to bypass document validation, or null if unspecified
        Returns:
        this
        Since server release
        3.2
      • ordered

        public InsertOptions ordered​(boolean ordered)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets whether the server should insert the documents in the order provided.
        Parameters:
        ordered - true if documents should be inserted in order
        Returns:
        this
      • writeConcern

        public WriteConcern writeConcern()
        Deprecated, for removal: This API element is subject to removal in a future version.
        The write concern to use for the insertion. By default the write concern configured for the MongoCollection instance will be used.
        Specified by:
        writeConcern in interface dev.morphia.internal.WriteConfigurable
        Returns:
        the write concern, or null if the default will be used.