Interface ExecutableUpdateOperation.TerminatingFindAndModify<T>
- All Known Subinterfaces:
ExecutableUpdateOperation.TerminatingUpdate<T>
- Enclosing interface:
ExecutableUpdateOperation
public static interface ExecutableUpdateOperation.TerminatingFindAndModify<T>
Trigger findAndModify execution by calling one of the terminating methods.
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionFind, modify and return the first matching document.@Nullable TFind, modify and return the first matching document.map(QueryResultConverter<? super T, ? extends R> converter) Map the query result to a different type usingQueryResultConverter.
-
Method Details
-
map
@Contract("_ -> new") <R> ExecutableUpdateOperation.TerminatingFindAndModify<R> map(QueryResultConverter<? super T, ? extends R> converter) Map the query result to a different type usingQueryResultConverter.- Type Parameters:
R-typeof the result.- Parameters:
converter- the converter, must not be null.- Returns:
- new instance of
ExecutableUpdateOperation.TerminatingFindAndModify. - Throws:
IllegalArgumentException- ifconverteris null.- Since:
- 5.0
-
findAndModify
Find, modify and return the first matching document.- Returns:
Optional.empty()if nothing found.
-
findAndModifyValue
@Nullable T findAndModifyValue()Find, modify and return the first matching document.- Returns:
- null if nothing found.
-