cursor.close()

Definition

  • cursor.close()

mongo Shell Method

This page documents the mongo shell method, and doesnot refer to the MongoDB Node.js driver (or any other driver)method. For corresponding MongoDB driver API, refer to your specificMongoDB driver documentation instead.

Instructs the server to close a cursorand free associated server resources. The server will automatically closecursors that have no remaining results, as well as cursors that have beenidle for a period of time and lack the cursor.noCursorTimeout()option.

The close() method has the followingprototype form:

  1. db.collection.find(<query>).close()