Package dev.morphia

Class InsertOneOptions

    • Constructor Detail

      • InsertOneOptions

        public InsertOneOptions()
        Creates a new options wrapper
      • InsertOneOptions

        @MorphiaInternal
        public InsertOneOptions​(InsertOneOptions 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 InsertOneOptions bypassDocumentValidation​(@Nullable
                                                         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
        @Deprecated(forRemoval=true,
                    since="2.3")
        public Boolean getBypassDocumentValidation()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Gets the the bypass document level validation flag
        Returns:
        the bypass document level validation flag
      • getOptions

        @Deprecated(forRemoval=true,
                    since="2.3")
        public InsertOneOptions getOptions()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the driver version of the options
      • options

        @MorphiaInternal
        public InsertOneOptions options()
        Returns:
        the driver version of the options
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • unsetMissing

        @Deprecated(forRemoval=true,
                    since="2.3")
        public boolean unsetMissing()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Applies the rules for storing null/empty values for fields not present in the object to be merged.
        Returns:
        this true if the rules for storing null/empty values should be applied
        Since:
        2.2
      • unsetMissing

        public InsertOneOptions unsetMissing​(boolean unset)
        Applies the rules for storing null/empty values for fields no present in the object to be merged.
        Parameters:
        unset - true if the rules should be applied
        Returns:
        this
        Since:
        2.2
      • writeConcern

        @Nullable
        public WriteConcern writeConcern()
        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 WriteConfigurable<InsertOneOptions>
        Returns:
        the write concern, or null if the default will be used.