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, Hyunsang Han
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA filter to specify which elements to modify in an array field. -
Method Summary
Modifier and TypeMethodDescriptionGet the specification which elements to modify in an array field.org.bson.Documentdefault booleanIncrement the value of a given key by1.booleanIf true prevents a write operation that affects multiple documents from yielding to other reads or writes once the first document is written.booleanCheck 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
Documentformat. Never null.
-
modifies
Check if a given key is modified by applying the update.- Parameters:
key- must not be null.- Returns:
- true if the actual
UpdateDefinitionattempts to modify the given key.
-
inc
Increment the value of a given key by1.- Parameters:
key- must not be null.- Returns:
thisupdate definition.
-
getArrayFilters
List<UpdateDefinition.ArrayFilter> getArrayFilters()Get the specification which elements to modify in an array field.UpdateDefinition.ArrayFilterare passed directly to the driver without further type or field mapping.- Returns:
- never null.
- Since:
- 2.2
-
hasArrayFilters
default boolean hasArrayFilters()- Returns:
- true if
UpdateDefinitioncontainsarray filters. - Since:
- 2.2
-