Package com.mongodb
Enum Class CursorType
- All Implemented Interfaces:
Serializable
,Comparable<CursorType>
,java.lang.constant.Constable
An enumeration of cursor types.
- Since:
- 3.0
- MongoDB documentation
- OP_QUERY
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA non-tailable cursor.Tailable means the cursor is not closed when the last data is retrieved.A tailable cursor with a built-in server sleep before returning an empty batch. -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
True if the cursor type is tailable.static CursorType
Returns the enum constant of this class with the specified name.static CursorType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NonTailable
A non-tailable cursor. This is sufficient for a vast majority of uses. -
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
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
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
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 nameNullPointerException
- 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
-