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
Modifier and TypeInterfaceDescriptionstatic interface
A 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.Document
default boolean
void
Increment the value of a given key by1
.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
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
Increment the value of a given key by1
.- Parameters:
key
- must not be null.
-
getArrayFilters
List<UpdateDefinition.ArrayFilter> 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
containsarray filters
. - Since:
- 2.2
-