Interface ExecutableFindOperation.TerminatingProjection
- 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.TerminatingProjection
Trigger find execution by calling one of the terminating methods.
- Since:
- 5.0
- Author:
- Christoph Strobl
-
Method Summary
-
Method Details
-
count
long count()Get the number of matching elements.
This method uses anaggregation executioneven for emptyquerieswhich may have an impact on performance, but guarantees shard, session and transaction compliance. In case an inaccurate count satisfies the applications needs useMongoOperations.estimatedCount(String)for empty queries instead.- Returns:
- total number of matching elements.
-
exists
boolean exists()Check for the presence of matching elements.- Returns:
- true if at least one matching element exists.
-