Node Mongo Native - how to tell when a cursor is exhausted?
问题 The documentation for the node-mongo-native collection.find() function says that it creates a cursor object which lazily returns the matching documents. Furthermore: The basic operation on a cursor is the nextObject method that fetches the next matching document from the database. The convenience methods each and toArray call nextObject until the cursor is exhausted. Unfortunately, the documentation provides no indication of how to tell when the cursor is actually exhausted. You could use the