Class UpdateOneModel<T>


  • public class UpdateOneModel<T>
    extends WriteModel<T>
    • Constructor Detail

      • UpdateOneModel

        public UpdateOneModel​(JsonObject filter,
                              JsonObject update)
        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​(JsonObject filter,
                              JsonObject update,
                              UpdateOptions options)
        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​(JsonObject filter,
                              JsonArray update)
        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
        Since server release
        4.2
      • UpdateOneModel

        public UpdateOneModel​(JsonObject filter,
                              JsonArray update,
                              UpdateOptions options)
        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
        Since server release
        4.2
    • Method Detail

      • getFilter

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

        public JsonObject getUpdate()
        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

        public JsonArray getUpdatePipeline()
        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
        Since server release
        4.2
      • getOptions

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