mongodb / v3.6 / reference / reference-method-cursor.isClosed.html

cursor.isClosed()

  • cursor. isClosed ( )
Returns: Boolean.

如果服务器已关闭游标,则cursor.isClosed()返回true

闭合的光标可能仍具有最后接收的批次中剩余的文档。使用cursor.isExhausted()cursor.hasNext()检查光标是否完全耗尽。