cursor.hasNext()Importante
Método mongosh
This page documents a
mongoshmethod. This is not the documentation for a language-specific driver, such as Node.js.Para los drivers de API de MongoDB, consulte la documentación del driver de MongoDB específica del lenguaje.
Devuelve: Booleano.
cursor.hasNext()returnstrueif the cursor returned by thedb.collection.find()query can iterate further to return more documents. If the client-side cursor batch is empty and the server has more data,hasNext()fetches the next batch from the server.
Compatibilidad
Este método está disponible en implementaciones alojadas en los siguientes entornos:
- MongoDB Atlas: El servicio totalmente gestionado para implementaciones de MongoDB en la nube
Nota
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: La versión basada en suscripción y autogestionada de MongoDB
MongoDB Community: La versión de MongoDB con código fuente disponible, de uso gratuito y autogestionada.