Interface ExecutableFindOperation.TerminatingResults<T>
- All Known Subinterfaces:
ExecutableFindOperation.ExecutableFind<T>, ExecutableFindOperation.FindWithCollection<T>, ExecutableFindOperation.FindWithProjection<T>, ExecutableFindOperation.FindWithQuery<T>, ExecutableFindOperation.TerminatingFind<T>
- Enclosing interface:
ExecutableFindOperation
public static interface ExecutableFindOperation.TerminatingResults<T>
Trigger find execution by calling one of the terminating methods.
- Since:
- 5.0
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionall()Get all matching elements.first()Get the first or no result.@Nullable TGet the first or no result.map(QueryResultConverter<? super T, ? extends R> converter) Map the query result to a different type usingQueryResultConverter.one()Get exactly zero or one result.@Nullable ToneValue()Get exactly zero or one result.scroll(ScrollPosition scrollPosition) Return a window of elements either starting or resuming atScrollPosition.stream()Stream all matching elements.
-
Method Details
-
map
@Contract("_ -> new") <R> ExecutableFindOperation.TerminatingResults<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
ExecutableFindOperation.TerminatingResults. - Throws:
IllegalArgumentException- ifconverteris null.- Since:
- 5.0
-
one
Get exactly zero or one result.- Returns:
Optional.empty()if no match found.- Throws:
IncorrectResultSizeDataAccessException- if more than one match found.
-
oneValue
@Nullable T oneValue()Get exactly zero or one result.- Returns:
- null if no match found.
- Throws:
IncorrectResultSizeDataAccessException- if more than one match found.
-
first
Get the first or no result.- Returns:
Optional.empty()if no match found.
-
firstValue
-
all
-
stream
-
scroll
Return a window of elements either starting or resuming atScrollPosition.When using
KeysetScrollPosition, make sure to use non-nullablesort propertiesas MongoDB does not support criteria to reconstruct a query result from absent document fields or null values through$gt/$ltoperators.- Parameters:
scrollPosition- the scroll position.- Returns:
- a window of the resulting elements.
- Since:
- 4.1
- See Also:
-