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 drivers de API do MongoDB, consulte a documentação do driver do MongoDB específica da linguagem.
Retorna: Boolean.
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.
Compatibilidade
Esse método está disponível em implantações hospedadas nos seguintes ambientes:
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
Observação
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: a versão autogerenciada e baseada em assinatura do MongoDB
MongoDB Community: uma versão com código disponível, de uso gratuito e autogerenciada do MongoDB