Interface UpdateDefinition

All Known Implementing Classes:
AggregationUpdate, BasicUpdate, Update

public interface UpdateDefinition
Interface fixing must have operations for updates as implemented via Update.
Since:
2.2
Author:
Christoph Strobl, Mark Paluch
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A filter to specify which elements to modify in an array field.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the specification which elements to modify in an array field.
    org.bson.Document
     
    default boolean
     
    void
    inc(String key)
    Increment the value of a given key by 1.
    If true prevents a write operation that affects multiple documents from yielding to other reads or writes once the first document is written.
    boolean
    Check if a given key is modified by applying the update.
  • Method Details

    • isIsolated

      Boolean isIsolated()
      If true prevents a write operation that affects multiple documents from yielding to other reads or writes once the first document is written.
      Returns:
      true if update isolated is set.
    • getUpdateObject

      org.bson.Document getUpdateObject()
      Returns:
      the actual update in its native Document format. Never null.
    • modifies

      boolean modifies(String key)
      Check if a given key is modified by applying the update.
      Parameters:
      key - must not be null.
      Returns:
      true if the actual UpdateDefinition attempts to modify the given key.
    • inc

      void inc(String key)
      Increment the value of a given key by 1.
      Parameters:
      key - must not be null.
    • getArrayFilters

      Get the specification which elements to modify in an array field. UpdateDefinition.ArrayFilter are passed directly to the driver without further type or field mapping.
      Returns:
      never null.
      Since:
      2.2
    • hasArrayFilters

      default boolean hasArrayFilters()
      Returns:
      true if UpdateDefinition contains array filters.
      Since:
      2.2