Package com.mongodb

Enum Class CursorType

java.lang.Object
java.lang.Enum<CursorType>
com.mongodb.CursorType
All Implemented Interfaces:
Serializable, Comparable<CursorType>, java.lang.constant.Constable

public enum CursorType extends Enum<CursorType>
An enumeration of cursor types.
Since:
3.0
MongoDB documentation
OP_QUERY
  • Enum Constant Details

    • NonTailable

      public static final CursorType NonTailable
      A non-tailable cursor. This is sufficient for a vast majority of uses.
    • Tailable

      public static final CursorType Tailable
      Tailable means the cursor is not closed when the last data is retrieved. Rather, the cursor marks the final object's position. You can resume using the cursor later, from where it was located, if more data were received. Like any "latent cursor", the cursor may become invalid at some point - for example if the final object it references were deleted.
    • TailableAwait

      public static final CursorType TailableAwait
      A tailable cursor with a built-in server sleep before returning an empty batch. In most cases this is preferred type of tailable cursor, as it is less resource intensive.
  • Method Details

    • values

      public static CursorType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CursorType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isTailable

      public abstract boolean isTailable()
      True if the cursor type is tailable.
      Returns:
      true if the cursor type is tailable