Package dev.morphia

Class InsertOneOptions

    • Constructor Detail

      • InsertOneOptions

        public InsertOneOptions()
        Creates a new options wrapper
      • InsertOneOptions

        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
        public Boolean getBypassDocumentValidation()
        Gets the the bypass document level validation flag
        Returns:
        the bypass document level validation flag
      • 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
      • unsetMissing

        public boolean unsetMissing()
        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
      • writeConcern

        @Nullable
        public com.mongodb.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.
      • getOptions

        public com.mongodb.client.model.InsertOneOptions getOptions()
        Returns:
        the driver version of the options