The type of the elements in the cursor.
Returns an iterator for the cursor, allowing it to be used in for...of
loops.
The iterator fetches all the results from the cursor.
An iterator over the fetched results.
Return remaining objects in the cursor as an array. This method exhausts the cursor
Applies a sort operation to the cursor using the specified sort modifier.
The current cursor instance for method chaining.
Returns the number of objects return in the cursor. This method exhausts the cursor
Iterates over all elements in the cursor and executes the provided callback function for each element.
Determines if there are more elements available in the cursor.
This method checks if there are any elements left in the internal buffer.
If the buffer is empty, it attempts to fetch the next element from the source.
If a new element is found, it is added to the buffer and the method returns true
.
Otherwise, it returns false
indicating no more elements are available.
true
if there are more elements to iterate over, otherwise false
.
Transforms the elements of the cursor using the provided callback function.
The type of the elements in the resulting array.
An array of transformed elements of type R
.
Retrieves the next item in the cursor.
If there are items in the internal buffer, the next item is returned from the buffer. Otherwise, it fetches the next item from the underlying data source.
The next item of type T
if available, or undefined
if there are no more items.
The
Cursor
class provides a mechanism for iterating over a collection of data with support for filtering, projection, sorting, skipping, and limiting results. It is designed to be chainable and supports lazy evaluation for efficient data processing.