cursor.hasNext()

cursor.hasNext()

mongo Shell Method

This page documents the mongo shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. 本页记录了mongo shell方法,未提及MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。

Returns:Boolean.

cursor.hasNext() returns true if the cursor returned by the db.collection.find() query can iterate further to return more documents.如果db.collection.find()查询返回的游标可以进一步迭代以返回更多文档,则cursor.hasNext()返回true