MongoDB: cursor.objsLeftInBatch() method

Last update on April 14 2018 06:14:57 (UTC/GMT +8 hours)

cursor.objsLeftInBatch

The cursor.objsLeftInBatch() method is used to return the number of documents left in the current cursor batch.

The MongoDB instance returns response in batches. To retrieve all the documents from a cursor may require multiple batch responses from the MongoDB instance. When there are no more documents remaining in the current batch, the cursor will retrieve another batch to get more documents until the cursor exhausts.