Package dev.morphia

Class UpdateOptions

  • java.lang.Object
    • com.mongodb.client.model.UpdateOptions
      • dev.morphia.UpdateOptions
  • All Implemented Interfaces:
    dev.morphia.internal.SessionConfigurable<UpdateOptions>, dev.morphia.internal.WriteConfigurable<UpdateOptions>

    public class UpdateOptions
    extends com.mongodb.client.model.UpdateOptions
    implements dev.morphia.internal.SessionConfigurable<UpdateOptions>, dev.morphia.internal.WriteConfigurable<UpdateOptions>
    The options to apply when updating documents in the MongoCollection
    Since:
    1.3
    • Constructor Detail

      • UpdateOptions

        public UpdateOptions()
    • Method Detail

      • clientSession

        public UpdateOptions clientSession​(com.mongodb.client.ClientSession clientSession)
        Description copied from interface: dev.morphia.internal.SessionConfigurable
        Set the client session to use for the insert.
        Specified by:
        clientSession in interface dev.morphia.internal.SessionConfigurable<UpdateOptions>
        Parameters:
        clientSession - the client session
        Returns:
        this
      • clientSession

        public com.mongodb.client.ClientSession clientSession()
        Description copied from interface: dev.morphia.internal.SessionConfigurable
        The client session to use for the insertion.
        Specified by:
        clientSession in interface dev.morphia.internal.SessionConfigurable<UpdateOptions>
        Returns:
        the client session
      • isMulti

        public boolean isMulti()
        Returns:
        true if the update should affect all entities
      • multi

        public UpdateOptions multi​(boolean multi)
        If true, sets this update to affect all matched documents.
        Parameters:
        multi - true for multiple updates
        Returns:
        this
      • upsert

        public UpdateOptions upsert​(boolean upsert)
        Overrides:
        upsert in class com.mongodb.client.model.UpdateOptions
      • bypassDocumentValidation

        public UpdateOptions bypassDocumentValidation​(Boolean bypassDocumentValidation)
        Overrides:
        bypassDocumentValidation in class com.mongodb.client.model.UpdateOptions
      • collation

        public UpdateOptions collation​(com.mongodb.client.model.Collation collation)
        Overrides:
        collation in class com.mongodb.client.model.UpdateOptions
      • arrayFilters

        public UpdateOptions arrayFilters​(List<? extends org.bson.conversions.Bson> arrayFilters)
        Overrides:
        arrayFilters in class com.mongodb.client.model.UpdateOptions
      • writeConcern

        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 dev.morphia.internal.WriteConfigurable<UpdateOptions>
        Returns:
        the write concern, or null if the default will be used.
      • writeConcern

        public UpdateOptions writeConcern​(com.mongodb.WriteConcern writeConcern)
        Sets the write concern
        Specified by:
        writeConcern in interface dev.morphia.internal.WriteConfigurable<UpdateOptions>
        Parameters:
        writeConcern - the write concern
        Returns:
        this