tryNext

abstract fun tryNext(): T?

A special next case that returns the next element in the iteration if available or null.

Tailable cursors are an example where this is useful. A call to tryNext may return null, ut in the future calling tryNext would return a new element if a document had been added to the capped collection.

Return

the next element in the iteration if available or null.

See also