Class UpdateOneModel<T>

java.lang.Object
com.mongodb.client.model.WriteModel<T>
com.mongodb.client.model.UpdateOneModel<T>
Type Parameters:
T - the type of document to update. In practice this doesn't actually apply to updates but is here for consistency with the other write models

@Deprecated(since="2021-05-27") public final class UpdateOneModel<T> extends WriteModel<T>
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
A model describing an update to at most one document that matches the query filter. The update to apply must include only update operators.
Since:
3.0
  • Constructor Details

    • UpdateOneModel

      public UpdateOneModel(Bson filter, Bson update)
      Deprecated.
      Construct a new instance.
      Parameters:
      filter - a document describing the query filter, which may not be null.
      update - a document describing the update, which may not be null. The update to apply must include only update operators.
    • UpdateOneModel

      public UpdateOneModel(Bson filter, Bson update, UpdateOptions options)
      Deprecated.
      Construct a new instance.
      Parameters:
      filter - a document describing the query filter, which may not be null.
      update - a document describing the update, which may not be null. The update to apply must include only update operators.
      options - the options to apply
    • UpdateOneModel

      public UpdateOneModel(Bson filter, List<? extends Bson> update)
      Deprecated.
      Construct a new instance.
      Parameters:
      filter - a document describing the query filter, which may not be null.
      update - a pipeline describing the update, which may not be null.
      Since:
      3.11
    • UpdateOneModel

      public UpdateOneModel(Bson filter, List<? extends Bson> update, UpdateOptions options)
      Deprecated.
      Construct a new instance.
      Parameters:
      filter - a document describing the query filter, which may not be null.
      update - a pipeline describing the update, which may not be null.
      options - the options to apply
      Since:
      3.11
  • Method Details

    • getFilter

      public Bson getFilter()
      Deprecated.
      Gets the query filter.
      Returns:
      the query filter
    • getUpdate

      @Nullable public Bson getUpdate()
      Deprecated.
      Gets the document specifying the updates to apply to the matching document. The update to apply must include only update operators.
      Returns:
      the document specifying the updates to apply
    • getUpdatePipeline

      @Nullable public List<? extends Bson> getUpdatePipeline()
      Deprecated.
      Gets the pipeline specifying the updates to apply to the matching document. The update to apply must include only update operators.
      Returns:
      the pipeline specifying the updates to apply
      Since:
      3.11
    • getOptions

      public UpdateOptions getOptions()
      Deprecated.
      Gets the options to apply.
      Returns:
      the options
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object