Package dev.morphia

Class DeleteOptions

  • All Implemented Interfaces:
    dev.morphia.internal.CollectionConfigurable<DeleteOptions>, dev.morphia.internal.CollectionConfiguration, dev.morphia.internal.WriteConfigurable<DeleteOptions>

    public final class DeleteOptions
    extends DeleteOptions
    implements dev.morphia.internal.WriteConfigurable<DeleteOptions>, dev.morphia.internal.CollectionConfigurable<DeleteOptions>
    The options to apply when removing documents from the MongoCollection
    Since:
    1.3
    • Constructor Detail

      • DeleteOptions

        public DeleteOptions()
        Creates a new options instance
      • DeleteOptions

        @MorphiaInternal
        public DeleteOptions​(DeleteOptions 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

      • collection

        public DeleteOptions collection​(String collection)
        Sets the alternate collection to use for the operation.
        Specified by:
        collection in interface dev.morphia.internal.CollectionConfigurable<DeleteOptions>
        Parameters:
        collection - the name of the collection to use
        Returns:
        this
        Since:
        2.3
      • collection

        public String collection()
        Description copied from interface: dev.morphia.internal.CollectionConfigurable
        Returns the alternate collection to use for the operation. Might return null.
        Specified by:
        collection in interface dev.morphia.internal.CollectionConfigurable<DeleteOptions>
        Returns:
        the collection name or null
      • isMulti

        @Deprecated(forRemoval=true,
                    since="2.3")
        public boolean isMulti()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        is this delete for multiple documents
      • multi

        @MorphiaInternal
        public boolean multi()
        Returns:
        is this delete for multiple documents
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • multi

        public DeleteOptions multi​(boolean multi)
        Parameters:
        multi - true if this delete should affect multiple documents
        Returns:
        this
      • writeConcern

        public DeleteOptions writeConcern​(@Nullable
                                          WriteConcern writeConcern)
        Sets the write concern
        Specified by:
        writeConcern in interface dev.morphia.internal.WriteConfigurable<DeleteOptions>
        Parameters:
        writeConcern - the write concern
        Returns:
        this
      • writeConcern

        @Nullable
        public WriteConcern writeConcern()
        The write concern to use for the delete.
        Specified by:
        writeConcern in interface dev.morphia.internal.WriteConfigurable<DeleteOptions>
        Returns:
        the write concern, or null if the default will be used.