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

    Modifier and Type
    Method
    Description
    long
    Get the number of matching elements.
    boolean
    Check for the presence of matching elements.
  • Method Details

    • count

      long count()
      Get the number of matching elements.
      This method uses an aggregation execution even for empty queries which may have an impact on performance, but guarantees shard, session and transaction compliance. In case an inaccurate count satisfies the applications needs use MongoOperations.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.