Package com.mongodb

Enum CursorType

    • Enum Constant Detail

      • 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 Detail

      • values

        public static CursorType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CursorType c : CursorType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CursorType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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